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 09:40
In the lab, which of the following displayed a list of all installed services and included a description of the service, the current state, and whether the service started automatically or manually? a. the services manager b. the applications summary c. the recommended services d. list the safe services list
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 22:40
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
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, 17.11.2020 23:20
question
Mathematics, 17.11.2020 23:20
Questions on the website: 13722359