*I need help solving this. Stuck half way. Would someone mind giving me an example of their program of this?*
The local t-shirt shop sells shirts that retail for $12. Quantity discounts are given as follows:
Number of shirts Discount
5-10 10%
11-20 15%
21-30 20%
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 non-negative input.
Use the following sample runs to guide you:
Sample Run 1:
How many shirts would you like?
11
The cost per shirt is $10.20 and the total cost to you is $112.20.
Sample Run 2:
How many shirts would you like?
0
The cost per shirt is $12 and total cost to you is $0.
Sample Run 3:
How many shirts would you like?
-2
invalid input: this program only accepts non-negative numbers.
Sample Run 4:
How many shirts would you like?
4
The cost per shirt if $12 and total cost to you is $48.00.