Question: C++ A software company sells a package that retails for $99.95. Quantity discounts are given according to the following table. Quantity Discount 10-19 20% 20-49

C++

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

Quantity Discount 10-19 20% 20-49 30% 50-99 40% 100 or more 50%

Write a program that asks for the number of units sold, validates the number of units, and computes the total cost of the purchase. If the units sold are not valid, an error message should be printed and no formal report printed.

The $99.95 should be a constant in the program. Remember to test your program for all possible discounts.

Output should be appropriately formatted; in particular, dollar amounts should show two digits after the decimal to look like the following for a quantity of 20:

 Software Sales: Regular Price of 20: 1999.00 Discounted 30%: 599.70 Net Price: 1399.30

The 20 and the 30% should be printed as variables and not hardcoded.

If the user enter 1 notice how the output would look:

 Software Sales: Regular Price of 1: 99.95 Discounted 0%: 0.00 Net Price: 99.95

The program should have only 1 return statement at the end of the program. There should not have an exit or break in the program.

I'm having truble to show mutiple answers with if function. I appreciate the help.

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!