Sam runs a local musical equipment store in your neighbourhood. He has contracted you to create an interactive application that will assist him with customer purchases. Create a class named Customer Purchases that will contain get and set methods for a customer number, first name, surname, product, price and quantity. Create a separate class called Printing that will include a method called Print Details, that will print the Customer Invoice. In the Printing class include another method called Customer Purchase Report which will display the following information: REPORT OPTION PERCENTAGE TAX 15% COMMISSION 8.5% DISCOUNT 10% TOTAL (Price + Tax) – (Discount + Commission)
Write a Java code Using Arraylist and Inheritance.
Input Sample
Enter number of presidents: 5
Enter class president id: 10
Enter class president id: 20
Enter class president id: 30
Enter class president id: 40
Enter class president id: 50
Output :
power on class 10
power on class 20
power on class 30
power on class 40
power on class 50
power on school
Best president id: 10
or
Input
Enter number of presidents: 2
Enter class president id: 45
Enter class president id: 23
output :
power on class 45
power on class 23
power on school
Best president id: 45
or
Input:
Enter number of presidents: 0
output:
power on school
Create a class named Person , which contains . A function named print ( ) Two data fields i.e. person Name and age A class named Patient inherits Person class , which contains Two data fields i.e. disease Type and recommended Medicine Overridden function print ( ) to display all details relevant to a patient A class named Medicare Patient inherited from class Patient , which holds A data field representing the name of the hospital A data filed representing the name of the ward A data field representing room number Overridden function print ( ) isplay all details relevant to . . In the main function , create instances of derived classes to access respective print ( ) function using dynamic binding .
Consider a class Computer having . Two fields ( i.e. companyName , price ) and A single function named show ( ) A class named Desktop inherits Computer class and adds fields representing color , monitor size , and processor type and Override function named show ( ) to display values of its all attributes . A class named Laptop inherits Computer class and adds fields representing color , size , weight , and processor type and Override function named show ( ) to display values of its all attributes . Write a main ( ) function that instantiates objects of derived classes to access respective show ( ) function using dynamic binding .
Write an interactive program that is a dialogue between two people. The dialogue should include strings, integers, and double numbers. Make the program more useful by implementing some math calculation. Also, include two types of comments at the proper places
A school called ‘Danville’ has a provision of keeping 2 kinds of Presidents: School President and Class president. (President class can be either a concrete class or an abstract class or an interface. You need to determine what it will be from the following clues.) There can be only 1 school president but there can be multiple class presidents. School and class presidents do not have any common attribute but they have a common school name which is fixed as ‘Danville’. Class presidents have a class id which school presidents do not have. Both school president and class president have a common method named exercisePower but their implementations are different. It prints “Exercising power on school” for the former and “Exercising power on class __” for the latter.
It is the final of the world’s most prestigious cricket tournament, the Indian Premier League. In the final, the Chennai Super Kings (CSK) are playing against the Mumbai Indians (MI). There is one over left for the match to end and CSK require R runs to win with W wickets remaining.
* Please select the correct letter choice "A, B, C, D, or E"
10. Which can set the background color of "panel1" to red?
A. panel1.setBackground(red);
B. panel1.setBackgroundColor(red);
C. panel1.setBackground(Color) = "red";
D. panel1.setBackground(Color.red);
E. panel1.setBackground = Color.red;
* Please select the correct letter choice "A, B, C, D, or E"
9. Which can nullify a JPanel’s layout manager?
A. pane1.setLayout(void);
B. pane1.setLayout(no);
C. pane1.setLayout(false);
D. pane1.setLayout();
E. pane1.setLayout(null);