Code a program that asks for the number of units purchased


So while researching C++ coding I ran across this example problem and it has me dumbfounded; I would like to understand how to code such an example. Please include source code and associated output.

A software company sells a package that retails for 199. Quantity discounts are given according to the following table.

Quantity Discount

10-19 20%

20-49 30%

50-99 40%

100 or more 50%

Code a program that asks for the number of units purchased and computes the total cost of the purchase.

Input Validation: Decide how the program should handle an input of less than 0

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Code a program that asks for the number of units purchased
Reference No:- TGS02845535

Now Priced at $10 (50% Discount)

Recommended (93%)

Rated (4.5/5)