subject

python Design a class named Vehicle that contains A private string data field named make A private string data field named model A private int data field named value A private int data field named mileage A constructor that creates a Vehicle object with the specified make (default "none"), model (default "none"), value (default 20000), mileage (default 0). The accessor and mutator methods for make, model, value, and mileage. A method named milesdriven that adds a specified number of miles to mileage A method name valueloss that subtract a specified value from value A method name vehicleage() that returns the age of the vehicle based on mileage (10,000 miles driven per year) Write a test program that creates a Vehicle object with a make of Ford, model F-150, value of 20000, and mileage of 0. Use the random number generator to generate a number between 0 - 50,000 and use the milesdriven method to update the mileage on the vehicle. Using the same random number that was generated, calculate the depreciation of the car (.1*mileage) and use the valueloss method to update the value of the vehicle. Print out the make, model, mileage, current value, and vehicle age using similar output.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
You know the right answer?
python Design a class named Vehicle that contains A private string data field named make A private s...
Questions
question
Mathematics, 15.10.2019 04:50