Question: Question 1 ( See Java Project Attached, Complete the code ) You are tasked with building a simple system for a car showroom that deals
Question See Java Project Attached, Complete the code
You are tasked with building a simple system for a car showroom that deals with different
brands of cars. The showroom manages cars of different brands, including Ford and Tesla.
Each car brand has unique features and specifications. The showroom needs to keep track of
its inventory and allow potential buyers to view car details.
Requirements:
Create a class Car:
a It should be an abstract class that represents a general car.
b It should have the following private attributes: modelName String price
double and year int
c It should have a constructor to initialize these attributes.
d Provide public getter mmethods for these attributes.
e Provide an abstract method showCarDetails to display the car details.
Create a class Ford that:
a Inherits from the Car class.
CSC Dr Sanika Doolani
b Implements the showCarDetails method to display Fordspecific details.
c Has additional attributes: isEcoBoost boolean and warrantyYears int
d Contains a constructor to initialize all attributes including those inherited from
Car
Create a class Tesla that:
a Inherits from the Car class.
b Implements the showCarDetails method to display Teslaspecific details.
c Has additional attributes: autopilotEnabled boolean and batteryLife
int
d Contains a constructor to initialize all attributes including those inherited from
Car
Create an interface IShowroom:
a The interface should have methods addCarCar car and
showInventory
Create a class CarShowroom that:
a Implements the IShowroom interface.
b Maintains the count of cars in the showroom inventory using an int
inventory
c Implements the showInventory method to display the number of all cars in
the inventory by calling showCarDetails
Create a App class to demonstrate the following:
a Create objects for Ford and Tesla cars.
b Add these cars to the showroom.
c Display the inventory.
Last Minute Requirement: The Car Showroom should only have a maximum inventory
of cars
a In the interface, add MAXNUMOFCARS of value
b When adding a car to the method addCarCar car check whether the
inventory is less than MAXNUMOFCARS. If not, display an output of Cannot
add this car
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
