Question: Write A class named car Q4 [40 pts] Write a class named Car that contains the following instance variables int data field named plateNumber for

Write A class named car  Write A class named car Q4 [40 pts] Write a class
named Car that contains the following instance variables int data field named
plateNumber for the car plate number. int data field named yearModel for

Q4 [40 pts] Write a class named Car that contains the following instance variables int data field named plateNumber for the car plate number. int data field named yearModel for the car year model A string data field named color for the car color. It contains the following methods: A constructor that initializes the plateNumber, yearModel and color. A set and get method for each instance variable. Write a class CarService that contains the following instance variables: Array named carsArray of type Car int data field named maxSize for the array size lt contains the following methods: A constructor that initializes the max and creates the array carsArray, Size void Add(int, int String) that creates and adds the Car to the array. The method prints an error message if the array is full. boolean search (int) that checks whether the Car object with car plate number passed as parameter exists in the array or not. Car serviced 0 that removes the first car from the array and shift the array to the left. void print() that prints all cars in the array in a tabular format as shown in the sample output. Write a test application named CarTest. In the main method, do the following: Creates a CarService object with max size 5. Display a menu of choices as shown in the sample output. The program stops when the user enters choice 5. Note: For class name, use the names provided in the question (Car.java, CarService.java, CarTest-java) Sample output: Enter your choice: 1. Add cars Service a car 3. Print available cars Search for a Car 5 Exit Enter Car plate number or -1 to stop: Enter Year Model 2008 Enter car color Red Enter car plate number or -1 to stop 890 Enter Year Model Enter Car color

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!