A software company sells a package that retails for $99. Quantity discounts are given according to the following table. Write a program that asks for the number of units sold and computes the total cost. Quantity 10-19 20-49 50-99 Discount 20% 30% 40% 50% 100 or more

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter4: Control Structures I (selection)
Section: Chapter Questions
Problem 20PE: The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a...
icon
Related questions
Question
If else
A software company sells a package that retails for $99. Quantity discounts are given
according to the following table. Write a program that asks for the number of units sold
and computes the total cost.
Discount
Quantity
10-19
20%
20-49
50-99
100 or more
30%
40%
50%
So for example if you ordered 5 items it would cost you $495. (No discount)
If you ordered 25 items it would cost you $1732.50. (25 * 99) then with a 30% discount.
Note:
Note that if you can use the round(a,2) method to round a number to two decimal
places.
If a = 4.56789 and you type b
= round(a, 2) then b will equal 4.57 because it
rounds it.
Transcribed Image Text:A software company sells a package that retails for $99. Quantity discounts are given according to the following table. Write a program that asks for the number of units sold and computes the total cost. Discount Quantity 10-19 20% 20-49 50-99 100 or more 30% 40% 50% So for example if you ordered 5 items it would cost you $495. (No discount) If you ordered 25 items it would cost you $1732.50. (25 * 99) then with a 30% discount. Note: Note that if you can use the round(a,2) method to round a number to two decimal places. If a = 4.56789 and you type b = round(a, 2) then b will equal 4.57 because it rounds it.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning