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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
Answers: 2
question
Computers and Technology, 24.06.2019 10:10
Scanning the road can be thought of as a
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
In the rgb model, which color is formed by combining the constituent colors? a) black b) brown c) yellow d) white e) blue
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
question
Mathematics, 01.12.2021 22:10
question
Mathematics, 01.12.2021 22:10
question
Mathematics, 01.12.2021 22:10
Questions on the website: 13722362