Question: JAVA LANGUAGE Use your Car class and create a new class that represents a Used Car. Your program will simulate a listing system for the

JAVA LANGUAGE

Use your Car class and create a new class that represents a "Used Car". Your program will simulate a listing system for the business, where the staff will manage the car information. Start by creating an array of 5 cars, with an "ID" of 0 through 4, and use the default constructor to create each car. For instance, the fifth car in an array called cars would have ID 4. You would access it by using:

cars[4]

To display this car's information, you would use:

cars[4].toString();

Use a loop to assist you initialize each car.

The system ought to first prompt the user for an ID, and ensure that it's valid from 0 through 4. Once the id is accepted, the menu ought to be displayed as follows:

JAVA LANGUAGE Use your Car class and create a new class that Set Make - Get the new Make from the user, and set it to the present car's Make field

represents a "Used Car". Your program will simulate a listing system for Set Model - Get the new Model from the user, and set it to the present car's Model field

the business, where the staff will manage the car information. Start by Set Year - Get the new Year from the user, and set it to the present car's Year field

creating an array of 5 cars, with an "ID" of 0 through Set Cost - Get the new Cost from the user, and set it to the present car's Cost field

4, and use the default constructor to create each car. For instance, Set Color - Get the new Color from the user, and set it to the present car's Color field

the fifth car in an array called cars would have ID 4. Show Car Information

You would access it by using: cars[4] To display this car's information, Exit, and opt for new car ID

Any other menu option, a message will appear as invalid. Your program should run continuously. The "Exit" option can prompt the user to pick a new ID and start entering/displaying information for a distinct car.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!