Question: ( 6 ) Objective The primary objective of this lab assignment is to strengthen your understanding of object - oriented programming in Java, with an

(6) Objective
The primary objective of this lab assignment is to strengthen your understanding of object-
oriented programming in Java, with an emphasis on the concept of aggregation. The theme for
this assignment revolves around cars and their various components. As always, you will make
use of the
class to collect user input.
Instructions:
Create the Engine class: This class will have the attributes: engineType, horsePower,
and fuelType.
1.1. All attributes will be set by user input.
1.2. Include appropriate getter and setter methods for these attributes.
Create the class: This class will have the attributes: carMake, carModel, carYear,
and engine.
2.1. The carMake, carModel, and carYear attributes will be set by user input.
2.2. The engine attribute will be an object of the Engine class.
2.3. Include appropriate getter and setter methods for these attributes.
Create the Dealership class: This class will have the attributes: dealershipName,
location, and car.
3.1. The dealershipName and location attributes will be set by user input.
3.2. The car attribute will be an object of the class.
3.3. Include appropriate getter and setter methods for these attributes.
Write your main program:
4.1. 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.
4.2. Instantiate the Engine, Car, and
classes with the information provided
by the user.
4.3. Finally, output the information about the dealership, the car, and its engine in a clear
and descriptive format.
Remember to adhere to best practices for clean, efficient code, such as using appropriate
naming conventions, encapsulation, using constants instead of hard-coded values where
possible, and including comments to explain your code. Good luck!
Note: Use Copy constructors where appropriate
Deliverables
Upload the following files in a zip folder that you have created:
Java class files
Screenshot of the Console with the code executing
( 6 ) Objective The primary objective of this lab

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 Programming Questions!