0% found this document useful (0 votes)
13 views2 pages

Python Script - Income

question 4

Uploaded by

Mark McKinsnkey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Python Script - Income

question 4

Uploaded by

Mark McKinsnkey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

BUNPRICE = 0.

50
COFFEEPRICE = 1.20
CAKEPRICE = 1.50
SANDWICHPRICE = 2.10
DESSERTPRICE = 4.00

while True:
try:
print("Enter the number of buns sold:")
amountBuns = int(input(": "))
except ValueError:
print("Invalid input!")
continue
else:
break

while True:
try:
print("Enter the number of coffees sold:")
amountCoffees = int(input(": "))
except ValueError:
print("Invalid input!")
continue
else:
break

while True:
try:
print("Enter the number of cakes sold:")
amountCakes = int(input(": "))
except ValueError:
print("Invalid input!")
continue
else:
break

while True:
try:
print("Enter the number of sandwiches sold:")
amountSandwiches = int(input(": "))
except ValueError:
print("Invalid input!")
continue
else:
break

while True:
try:
print("Enter the number of desserts sold:")
amountDesserts = int(input(": "))
except ValueError:
print("Invalid input!")
continue
else:
break

incomeBuns = amountBuns * BUNPRICE


incomeCoffees = amountCoffees * COFFEEPRICE
incomeCakes = amountCakes * CAKEPRICE
incomeSandwiches = amountSandwiches * SANDWICHPRICE
incomeDesserts = amountDesserts * DESSERTPRICE

incomeTotal = incomeBuns + incomeCoffees + incomeCakes + incomeSandwiches +


incomeDesserts
print("Total income: ", incomeTotal)

You might also like