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:00
Which of the following is true of operations within a spreadsheet program’s built-in functions? a. operations within parentheses, then multiplication and division, and then addition and subtraction are computed. b. operations within parentheses, then addition and subtraction, and then multiplication and division are computed. c. multiplication and division, then addition and subtraction, and then operations within parentheses are computed. d. addition and subtraction, then multiplication and division, and then operations within parentheses are computed
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
Which type of cloud computing offers easily accessible software and applications on the machines
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
Questions on the website: 13722363