You are required to design a Car class which has following attributes
String brand;
Double price;
Double quantity;
String Model;
Boolean available;
1. Provide a toString() method to print values.
create an ArrayList of Cars in a class ShowRoom having name and address as attributes as well, Provide appropriate methods, store values in array List (take values form user).
Provide a buy method which will ask user to buy a Car by providing its name, check that it is present or not then ask for quantity and create bill for user.
After that you have to print the following:
2. Add Car, delete Car, Buy a Car, Display all cars
Also display:
· Car of brand “Audi”;
· Car with name starting with ‘L’.
· Car name end with ‘n’.
· Display only last three and first three letters of Showroom name.
Comments
Leave a comment