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

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