Question: This program has to be in python. Create a class named Car that has the following attributes: year model (car's year model) make (car's make)
Create a class named Car that has the following attributes: year model (car's year model) make (car's make) speed (car's current speed) It should also have the following methods: accelerate: adds 5 to the speed data attribute brake: subtract 5 from the speed of the car get speed: return the current speed - Use this class to create an instance of the car class by getting the car year, make, and current speed from user information. The program should then accelerate the car once. - If your program is correct, sample output might look as follows: Please the car's year: 2005 Please the car's make: Corolla Please the car's current speed in mph: 60 Now the 2005 Corolla is going 65 mph
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
