A shop will give discount of 10% if the cost of purchased quantity is more than
1000. Ask user for quantity. Suppose, one unit will cost 100.
Judge and print total cost for user.
Answers
Concept:-
Organizing, formatting, and storing data simplifies decision-making.
Given:-
The given that a quesion "A shop will give discount of if the cost of purchased quantity is more than . Ask user for quantity. Suppose, one unit will cost ."
Find:-
We have to find that Judge and print total cost for user.
Solution:-
According to the problem
includeiostream
using namespace std;
int main
int totalexp, qty, price, discount;
cout"Enter quantity:"; input value of quantity
cinqty;
cout"Enter price:"; input price
cin>>price;
; calculate total expenses
if condition to check total expenses is more than
discount; discount is applicable
totalexptotalexpdiscount;
cout<<"Total Expense is Rs. "totalexp;
return ;
Output
Enter quantity:
Enter price:
Total Expense is Rs.
Hence, total cost for user is Rs. .
#SPJ2