subject

Write a class named car that has the following data attributes:

• _ _year_model (for the car’s year model)
• _ _make (for the make of the car)
• _ _speed (for the car’s current speed)

the car class should have an _ _init_ _ method that accepts the car’s year model and make
as arguments. these values should be assigned to the object’s _ _year_model and _ _make
data attributes. it should also assign 0 to the _ _speed data attribute.
the class should also have the following methods:

• accelerate
the accelerate method should add 5 to the speed data attribute each time it is called.
• brake
the brake method should subtract 5 from the speed data attribute each time it is called.
• get_speed
the get_speed method should return the current speed.
next, design a program that creates a car object and then calls the accelerate method
five times. after each call to the accelerate method, get the current speed of the car and
display it. then call the brake method five times. after each call to the brake method, get
the current speed of the car and display it.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
You know the right answer?
Write a class named car that has the following data attributes:

• _ _year_model (for th...
Questions
question
Arts, 17.12.2020 01:00
question
Mathematics, 17.12.2020 01:00
question
Mathematics, 17.12.2020 01:00
question
Biology, 17.12.2020 01:00
Questions on the website: 13722363