Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A dealer wants to create a list of classic cars in her showroom. Using the existing Car class in this exercise. Create a static
A dealer wants to create a list of classic cars in her showroom. Using the existing Car class in this exercise. Create a static ArrayList called showroom that adds a Car to the showroom whenever a new Car is created. In the constructor, you will have to add that Car to the ArrayList. Now that the showroom ArrayList has been implemented, we need to create methods to access the list items. Create the following static methods for the Student class: getBestInShow() returns the name of the car in the first position of the showroom. You always show your best car first. gotBought (int index) - void method that removes the car from the showroom from that position oldestCar() - returns the name of the oldest car in the showroom Sample Output The oldest car in the showroom is the Pontiac Torpedo The best car in the showroom is the Chevrolet Bel Air I'll buy it! Here's the new showroom: Chevrolet Impala SS Coupe Pontiac Torpedo Cadillac Coupe De Ville Chevrolet Delray Delivery D
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Based on the requirements we need to modify the existing Car class and create the showroom ArrayList as well as implement the getBestInShow gotBoughti...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