subject

You are writing a program for a car rental company. This company rents more than one type of vehicle to customers and the employees use programs written in Java to keep track of the cars for rental. Write the following Java classes to demonstrate inheritance and class design. (1) A Vehicle class that has a VIN (of type string) and gasTank () of type double, properties, a full constructor, and an abstract method called displayDetails() which returns a string. (2) A Car class that inherits from Vehicle also has a size (of type string) to tell if it is a subcompact, compact, or fullsized car and a full constructor. It should have a method called displayDetails() which returns a string and tells about all of its attributes. (3) A Truck class that inherits from Vehicle also has a bedSize (of type integer) to how big it is, properties and a full constructor. It should have a method called displayDetails() which returns a string and tells about all of its attributes. Make sure to have correct data types and correct access modifiers (public/private/protected) Create a Car object in main() and a truck object in main() to test your newly created class definitions.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:00, Wolfie215
Which of the following is a way that advancements in technology improve humans' ability to measure air quality and protect human health? a. air quality data gathered by new instruments can be used to reduce exposure to pollutants. b. new technologies enable natural and human-made pollution sources to be located and monitored. c. air quality data gathered by new instruments can be used to predict trends in pollution over time. d. new technologies allow governments to make informed decisions about the regulation of pollution. (choose more than one)
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, ayoismeisalex
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, eila3601
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
image
Computers and Technology, 24.06.2019 02:10, ttangelique
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
You know the right answer?
You are writing a program for a car rental company. This company rents more than one type of vehicle...

Questions in other subjects: