0% found this document useful (0 votes)
7 views6 pages

Customer Discount Calculation Program

The document outlines a class structure for managing customer purchases, including data members for customer details and methods for input, calculation of discounts based on purchase cost, and displaying the final amount. It specifies discount percentages based on cost thresholds and provides a main method to create an object of the class and invoke its methods. Additionally, it includes a task to print a specific star pattern format.

Uploaded by

rajendrak503
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Customer Discount Calculation Program

The document outlines a class structure for managing customer purchases, including data members for customer details and methods for input, calculation of discounts based on purchase cost, and displaying the final amount. It specifies discount percentages based on cost thresholds and provides a main method to create an object of the class and invoke its methods. Additionally, it includes a task to print a specific star pattern format.

Uploaded by

rajendrak503
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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 :

You might also like