Tutorial 7
Tutorial 7
a) Write a clas s to repres ent a car us ed as a taxi. The attributes are: the m ake/ m anufacturer, the
m odel, the regis tration licence plate, total kilom etres driven, and a flag indicating whether it is
currently being driven out on the s treets . Include appropriate cons tructors , acces s ors , a mutator to
change the flag, and a m ethod to increas e the num ber of kilom etres driven.
b) Write a clas s , nam ed Cars Databas e, which will be us ed to provide the res pons ibility of data
m anagem ent of a s et of TaxiCar objects . Internally, it s hould us e an ArrayLis t of TaxiCar. It s hould
provide: