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.
In the Store class, make an ArrayList of customers, store name, and address implement methods
public void addSale(Customer c) that will add customers to the arraylist.
public void RemoveCustomer(int id);
public void UpdateCustomerRecord(int Id);
public displayAll();
public String nameOfBestCustomer() to record the sale and return the name of the customer with the largest sale.
public ArrayList nameOfBestCustomers(int topN)
so that it displays the top customers, that is, the topN customers with the largest sales, where topN is a value that the user of the program supplies.
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.
In the Store class, make an ArrayList of customers, store name, and address implement methods
public void addSale(Customer c) that will add customers to the arraylist.
public void RemoveCustomer(int id);
public void UpdateCustomerRecord(int Id);
public displayAll();
public String nameOfBestCustomer() to record the sale and return the name of the customer with the largest sale.
public ArrayList nameOfBestCustomers(int topN)
so that it displays the top customers, that is, the topN customers with the largest sales, where topN is a value that the user of the program supplies.
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.
Create a class customer having id, name, gender, and bill provide appropriate getters/setters and constructors also provide toString method. In the Store class, make an ArrayList of customers, store name, and address implement methods
public void addSale(Customer c) that will add customers to the arraylist.
public void RemoveCustomer(int id);
public void UpdateCustomerRecord(int Id);
public displayAll();
public String nameOfBestCustomer() to record the sale and return the name of the customer with the largest sale.
public ArrayList nameOfBestCustomers(int topN)
so that it displays the top customers, that is, the topN customers with the largest sales, where topN is a value that the user of the program supplies.
Write a program that prompts following menu and
1. Add Customer record
2. Delete Customer record
3. Update Customer record
4. View all Customers
5. View Best Customer.
6. Find Customer by ID.
Exit: Ask the user to enter his/her choice then perform the desired function as long as he/she wants.
In the Store class, make an ArrayList of customers, store name, and address implement methods
public void addSale(Customer c) that will add customers to the arraylist.
public void RemoveCustomer(int id);
public void UpdateCustomerRecord(int Id);
public displayAll();
public String nameOfBestCustomer() to record the sale and return the name of the customer with the largest sale.
public ArrayList nameOfBestCustomers(int topN)
so that it displays the top customers, that is, the topN customers with the largest sales, where topN is a value that the user of the program supplies.
Write a program that prompts following menu and
Menu
============================================
1. Add Customer record
2. Delete Customer record
3. Update Customer record
4. View all Customers
5. View Best Customer.
6. Find Customer by ID.
1. Exit.
Ask the user to enter his/her choice then perform the desired function as long as he/she wants.
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.
class MyClassCircle {
private double radius;
MyClassCircle(double radius) {
this.radius = radius;
}
public double getArea() {
return Math.PI * radius * radius;
}
}
class GetAreaDemo {
public static void main(String [] args) {
MyClassCircle circle = new MyClassCircle(5.6);
System.out.println("Area of the circle with radius 5.6 equal to " + cicle.getArea());
}
}
1. List down the variables you used and it's uses in the program.
2. What is the formula for getting the area of the circle, based on the codes?
Write a menu driven application to maintain the department details of a School
using Java to demonstrate the concept of Inheritance. Your application must contain
the following functionalities along with the use of method overriding, and super
keyword. Consider the example of school of CST having three departments CSE,
AI&SD and CE.
a. For each department maintain the following details.
i. deptName
ii. hodName
iii. noOfFaculty
iv. noOfStudents
v. noOfPrograms
b. Get the department details from user(admin)
c. Display the Department list with all details in a proper and neat format.
d. In the menu give an option to display department wise details.