Question: Write a C + + program that does the following: a . Create a C + + file with the name problem 4 . c

Write a C++program that does the following:
a. Create a C++ file with the name problem 4.cpp.
b. Implement the following program: A company sells items and applies the following discounts based
the quantity of the items bought:
Your program should do the following:
Ask the user how many items were purchased (an integer in the range 1-200). Give an error message s
as "Invalid quantity entered! Terminating the program..." and terminate the program if the quantity is
of this range.
Ask the user the price of each item (double)
Determine what % discount should be applied based on the table above
Calculate the costs before and after discount is applied
Print the information in a nicely formatted table
Sample run of the program:
How many items are bought? 250
Invalid quantity entered! Terminating the program...
Sample run of the program:
How many items are bought? 65
Enter the price of the item: 12.6
Write a C + + program that does the following: a

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 Programming Questions!