Question
a.Construct a class Car that has the following attributes: chassis no,type and listof services performed. Construct: i. constructor with parameters and getter/setter methods; ii.the addservice
a.Construct a class Car that has the following attributes: chassis no,type and listof services performed. Construct:
i. constructor with parameters and getter/setter methods;
ii.the addservice method that takes the service as a parameter and adds it to the list of services performed on the machine. The service should not be added if it exists;
iii. the number of services method that returns the number of services that have been performed on the machine.
b. Construct the taxi class which inherits from the car class and has the license number attribute. Construct the constructor of this class as well as the getters.setter methods for the lincenseNumber instance variable.Construct the toString() method which will display the taxi data.
c. Construct the test class.
The programming language is Java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started