(15
)
Question 4.
Define a class Discount having the following description:
Data Members:
int cost
to store the price of an article
String name
to store the customer's name
double de
to store the discount
double amt
to store the amount to be paid
Member function:
void input():
Stores the cost of the article and name of the customer
void cal 0
calculate the discount and amount to be paid
void display 0:
Displays the name of the customer, cost,
discount and amount to be paid
Write a program to compute the discount according to the given conditions and display
the output as per the given format-
Rate of discount
List price
No discount
Up to 5000 Rs
10% on the list price
From 5,001 Rs to 10,000 Rs
15% on the list price
From 10,001 Rs to 15,000 Rs
20% on the list price
Above 15,000 Rs
discount
amount to be paid
Output:
Name of customer
Answers
Answered by
2
Not fitting under 5000 characters
Similar questions