Question: Problem 5 : Problem 5 : Write a program to calculate a discount based on the quantity and the price of each item of purchasing.

Problem 5: Problem 5: Write a program to calculate a discount based on the quantity and the price of each item of purchasing. The program prompts the user to insert the positive purchased number of items (num should be positive) and the price of each item. The program calculates the price after discount as follows:
discount(num)={nochange,num10normalprice**0.2,10num20normalprice**0.3,20num50normalprice**0.4,50num100normalprice**0.5,num>100
Input /Output Samples:
Bnter quantity of purchasing: -2 Invalid quantity
Enter the quantity of purchasing: 10
Enter the price of each item: 30
You have bought 10 peices
The normal price is 300
The price after discount is:240
.. Program finished with exit code 0
Press ENTER to exit console.
I need answer with c++
 Problem 5: Problem 5: Write a program to calculate a discount

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!