You are required to design a Car class which has following attributes
String brand;
Double price;
Double quantity;
String Model;
Boolean available;
1. Provide default & Parameterized constructors.
2. Provide getters & setters for data members.
3. Provide a toString() method to print values.
Now 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
1. Add Car
2. Delete Car
3. Buy a Car.
4. 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