Read the problem listed below. Formulate a Decomposition or Outline of the problem. Determine if you have
Fantastic news! We've Found the answer you've been seeking!
Question:
I need to Create a program that will ask the user for number of chicken wings or wings they want to order at a restaurant. The number of wings and the sauce will determine if there is a discount on the total wings purchased. For hot wings purchased in a quantity of 6 or less there is no discount. Therefore the discount rate is 0.0. For hot wings and a quantity of more than 6 but less than or equal to 12, there is a 10% discount. For hot wings purchased in the amount of greater than 12 but less than 24 the discount is 20%. For sweet and sour wings, purchased with a quantity of 6 or less the discount is 5%. For sweet and sour wings and a quantity of greater than 6 but less than or equal to 12, the discount is 10%. For sweet and sour wings purchased with a quantity greater than 12 but less than or equal to 24, the discount is 15%. For all wing purchases greater than 24 wings, the discount is 25%. All wings are 50 cents each.
The program needs to ask the user for the type of wing either hot or sweet with the following prompt. There are no spaces after the word Type:
Type:
The program also needs to ask for the quantity of wings using the following prompt. There are no spaces after the word Quantity:
Quantity:
The program needs to determine the total cost of the wings and print that out with the following prompt. There are no spaces after the word Total:
Total:
Finally the program needs to ask the user if they want to purchase another order of wings using the following prompt. There are no spaces after the word Continue: The program will stop when the user enters Q to quit.
Continue:
Given that the user enters sour and 20, hot and 3 and also Q to end the program, your screen should print:
Type:sour
Quantity:20
Total: 8.5
Continue:Y
Type:hot
Quantity:3
Total: 1.5
Continue:Q
When you are done writing your program, click on the Try It button to open the terminal and test your program.
If your program is not running, click on the Code Visualizer link to run your code line by line. If that still doesn't help, copy the code to either IDLE or VS Code in order to better debug this program.
Code Visualizer
Wings - this is the code I did and it will not clear, below this is the error that I keep getting.
while(True):
print('Type:',end='')
t=input()
print('Quantity:',end='')
q=int(input())
dis=0.0
if(t=='hot'):
if(q>6 and q<=12):
dis=10.0
elif(q>12 and q<=24):
dis=20.0
elif(q>=25):
dis=25.0
else:
if(q<=5):
dis=5.0
elif(q>6 and q<=12):
dis=10.0
elif(q>12 and q<=24):
dis=15.0
elif(q>=25):
dis=25.0
tot=(q*.50)-((q*.50)*dis/100)
print('Total:',end="")
print(tot)
print('Continue:',end='')
ch=input()
if(ch=='Q'):
break
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: