Question: Create the Engine class: This class will have the attributes: engineType, horsePower, and fuelType. 1 . 1 . All attributes will be set by user
Create the Engine class: This class will have the attributes: engineType, horsePower, and fuelType.
All attributes will be set by user input.
Include appropriate getter and setter methods for these attributes.
Create the Car class: This class will have the attributes: carMake, carModel, carYear, and engine.
The carMake, carModel, and carYear attributes will be set by user input.
The engine attribute will be an object of the Engine class.
Include appropriate getter and setter methods for these attributes.
Create the Dealership class: This class will have the attributes: dealershipName, location, and car.
The dealershipName and location attributes will be set by user input.
The car attribute will be an object of the Car class.
Include appropriate getter and setter methods for these attributes.
Write your main program:
Use the Scanner class to collect user input for the engine's type, horsepower, and fuel type, the car's make, model, and year, and the dealership's name and location.
Instantiate the Engine, Car, and Dealership classes with the information provided by the user.
Finally, output the information about the dealership, the car, and its engine in a clear and descriptive format.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
