Professional Documents
Culture Documents
Member methods: –
Cost Discount
(in percentage)
void display() – To display customer name, mobile number, amount to be paid after
discount
Write a main method to create an object of the class and call the above member
methods.
import java.util.*;
obj.input();
obj.calculate();
obj.display();
class showRoom {
discount = (5*cost)/100;
discount = (10*cost)/100;
discount = (15*cost)/100;
else {
discount = (20*cost)/100;
}
}
name = input.nextLine();
mobileNumber = input.nextLong();
cost = input.nextDouble();
input.close();
showRoom() {
name ="";
mobileNumber = 0;
cost = 0;
discount = 0;
amount =0;