Question: Design and implement a class called Car that contains instance data that represents the company, price, model, and year of the car. Define the

Design and implement a class called Car that contains instance data that 



Design and implement a class called Car that contains instance data that represents the company, price, model, and year of the car. Define the Car constructor to initialize these values. Include getter and setter methods for all instance data, and a toString method that returns a one-line description of the car. Create a driver class called CarTest, whose main method instantiates array of Car objects and write the following methods: 1) Method "printInfo" that receives an array of cars and returns all information about all cars. 2) Methods that receives an array of cars and a string called co and returns an array that contains cars whose company equal to co. 3) A Method called getTopByCompany that receives an array of Cars and then returns an array of cars containing the cars that have the highest price compared with cars from the same company. 4) A Method called printByYear that receives an array of Cars and a String year and then prints all cars with that year. 5) Method that receives an array of cars array and prints the cars that have the oldest year. 6) A Method called getTopByYModel Year that receives an array of Cars and then returns an array of cars containing the cars that have the highest price compared with cars from the same year and model.

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!