QUESTION:
Data members / instance variables:
String name – to store the name of the customer
long mobno – to store the mobile number of the customer
double cost – to store the cost of the items purchased
double dis – to store the discount amount
double amount – to store the amount to be paid after discount
Member methods:
1. ShowRoom() – default constructor to initialize data members.
2. void input() – to input customer name, mobile number, cost.
3. void calculate() – to calculate discount on the cost of purchased items, based on the
following criteria:
Cost Discount (in percentage)
Less than or equal to ₹10,000 5%
More than ₹10,000 and less than or equal to ₹20,000 10%
More than ₹20,000 and less than or equal to ₹35,000 15%
More than ₹35,000 20%
4. void display() – to display customer name, mobile number, amount to be paid after
discount.
Task:
Write a main method to create an object of the class and call the above member methods.
OUTPUT :
QUESTION:
Write a program to print the following format:
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
OUTPUT :