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, 22.06.2019 18:00
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
question
Computers and Technology, 23.06.2019 08:00
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
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, 05.09.2020 01:01
Questions on the website: 13722363