Question: C + + Option 2 : The local t - shirt shop sells shirts that retail for $ 1 2 . Quantity dis - counts

C++
Option 2: The local t-shirt shop sells shirts that retail for $12. Quantity dis- counts are given as follow:
Number of Shirts Discount
51010%112015%213020%31 or more 25%
Write a program that prompts the user for the number of shirts required and then computes the total price. Make sure the program accepts only nonnegative input.
Use the following sample runs to guide you:
Sample Run 1:
How many shirts would you like ?
4
The cost per shirt is $12 and the total cost is $48
Sample Run 2:
How many shirts would you like ?
0
The cost per shirt is $12 and the total cost is $0
Sample Run 3:
How many shirts would you like ?
8
The cost per shirt is $10.80 and the total cost is $86.40
Sample Run 4:
How many shirts would you like ?
-2
Invalid Input: Please enter a nonnegative integer

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!