Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, QueenKy9576
Wich technology can a website use to allow you to listen to a concert live over the internet?
Answers: 3
image
Computers and Technology, 24.06.2019 00:00, Amrinderkhattra
Visualizing a game of β€œtag” to remember the meaning of contagious
Answers: 3
image
Computers and Technology, 24.06.2019 15:30, lizziesuks
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
image
Computers and Technology, 24.06.2019 19:20, boyancecristina
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
Do you know the correct answer?
python Design a class named Vehicle that contains A private string data field named make A private s...

Questions in other subjects: