Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import division #To stop 1//2 == 0 (From a friend
- #Name: Hy Diep
- #Date: 4-27-12
- #This script will help you determine the cost of your order at Dr. Joe's Pizzeria.
- def main():
- while True:
- #Pricing Variables
- Peporoni= 5.55
- Mushroom= 10.00
- Sasuage= 30.00
- Pineapple= 40.00
- Tax= .15
- #Pricing for pizza types.
- print ("Peporoni is 5.55")
- print ("Mushroom is 10.00")
- print ("Sasuage is 30.00")
- print ("Pineapple is 40.00")
- print ("Tax per person is 15%")
- print
- numberPizzas = input("How many whole pizzas? ")
- numberPeople = input("Number of People? ")
- typePizza = input("Type of Pizza? ")
- typeDiscountPercent = input("If avaliable, what is the discount percentage? (Number only) ")
- typeDiscountDecimal = typeDiscountPercent / 100
- if typeDiscountPercent > 0:
- Totaldiscount= str(((numberPizzas * typePizza) + (numberPeople * Tax)) * (1 - typeDiscountDecimal))
- if typeDiscountPercent < 0:
- Total= str((numberPizzas * typePizza) + (numberPeople * Tax))
- if typeDiscountPercent > 100:
- print "Error! Only numbers between 0 and 100!"
- else:
- if typeDiscountPercent > 0:
- print "Total Cost is " + (Totaldiscount)
- if typeDiscountPercent < -0:
- print "Error! Only numbers between 0 and 100! Please try Again!"
- else:
- if typeDiscountPercent < 0:
- print "Total Cost is " + (Total)
- Reset = raw_input("Do you need to restart? Yes or No ")
- if Reset is ("Yes") or ("YES") or ("YEs)" or ("yEs") or ("yeS") or ("Yse") :
- if Reset is ("no") or ("No") or ("nO") or ("NO") or ("on")
- break
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement