APlusGrades

Not Rated (0)

$15/per page/Negotiable

About APlusGrades

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing,Foreign Languages,Geography,Geology,Health & Medical,HR Management,Law,Management,Physics,Programming,Science,Statistics Hide all
Teaching Since: Jul 2017
Last Sign in: 364 Weeks Ago, 2 Days Ago
Questions Answered: 1850
Tutorials Posted: 1850

Education

  • Graduate in Biology and Nutrition, MBA Finance
    Florida State University
    Aug-2000 - Jul-2007

Experience

  • Ass. Relationship Manager
    Penn-Florida
    Mar-2009 - Feb-2016

Category > Programming Posted 20 Jul 2017 My Price 11.00

Java Program Demonstrating Inheritance you are writing a program for a car rental company.

Java Program Demonstrating Inheritance 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 to keep track of the cars for rental.

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.

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.

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.

 

Have correct data types and correct access modifiers (public/private/protected) as well as validation for gasTank and bedSize to prevent negative values in these class definitions.

Create a Car object in main() and a truck object in main() to test your newly created class definitions.  

Demonstrating Polymorhism for the car rental company. This company rents more than one type of vehicle to customers and the processes for the organization work with cars and trucks at the same time. Demonstrate how to handle this.

Change the test code in main to have an array of 4 Vehicles.

 

Write a loop that prompts the user 4 times.

The body of the loop should have an If statement asking the user if they are creating a car or a truck. If the user chose a Car it should ask for all of the values for a Car and store one in the next position in the array of vehicles. If it is a truck it should ask for all of the values for a Truck and store one in the next position in the array of vehicles.

After input is complete there should be a polymorphic loop through the array of vehicles that shows the details for all of them to the user with the displayDetails() method.

Answers

Not Rated (0)
Status NEW Posted 20 Jul 2017 03:07 PM My Price 11.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â-----------  -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I

Not Rated(0)