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:
Set Make - Get the new Make from the user, and set it to the present car's Make field
Set Model - Get the new Model from the user, and set it to the present car's Model field
Set Year - Get the new Year from the user, and set it to the present car's Year field
Set Cost - Get the new Cost from the user, and set it to the present car's Cost field
Set Color - Get the new Color from the user, and set it to the present car's Color field
Show Car 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
Get step-by-step solutions from verified subject matter experts
