Computer Science, asked by sp20bscs0012, 2 months ago

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

Answered by anvimalik867
0

Concept:-

Organizing, formatting, and storing data simplifies decision-making.

Given:-

The given that a quesion "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."

Find:-

We have to find that Judge and print total cost for user.

Solution:-

According to the problem

#\#include<iostream>

using namespace std;

int main()

\{

int totalexp, qty, price, discount;

cout<  <"Enter quantity:";  //input value of quantity

cin>  >qty;

cout<  <"Enter price:";   //input price

cin>>price;

totalexp=qty\times price;  // calculate total expenses

if(totalexp > 1000) //condition to check total expenses is more than 1000

\{

discount=(totalexp\times 0.1); //10\% discount is applicable

totalexp=totalexp-discount;

\}

cout<<"Total Expense is Rs. "&lt;  &lt;totalexp;

return 0;

\}

Output

Enter quantity:50

Enter price: 500

Total Expense is Rs. 22500

Hence, total cost for user is Rs. 22500.

#SPJ2

Similar questions