9.1 Using the Car and GreenCar classes, create a new class to keep a collection of Cars and GreenCars with a zero-based index. Make sure the client code can add, remove and point to a particular object. Add the required buttons so the client can choose a Car or GreenCar object, drive it and fill it with gas.

9.2 Add more code to the collection class code, so that the client can get inventory information about the total gallons of gas in the entire collection of Cars and GreenCars. In addition add code so the client can get information such as total mileage on all cars.

9.3 Add another function to the collection so that the client can use a LowestMileageItem as an altemative to the Item function.

9.4 In previous chapters you leamed how to create and throw user-de?ned exceptions. Create a new user-defined exception called DuplicateVINException. This will be thrown by the collection code whenever the client code attempts to create a new car that has a VIN that is already used by another car in the collection. In addition to the new code, what updates are needed, so that when the user tries to add such a car, the error message is shown, and the car is not useable.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.