Advertisement
Guest User

Untitled

a guest
Apr 30th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.96 KB | None | 0 0
  1. from __future__ import division #To stop 1//2 == 0 (From a friend
  2. #Name: Hy Diep
  3. #Date: 4-27-12
  4.  
  5.  
  6. #This script will help you determine the cost of your order at Dr. Joe's Pizzeria.
  7.  
  8.  
  9. def main():
  10.    
  11.     while True:
  12.         #Pricing Variables
  13.         Peporoni= 5.55
  14.         Mushroom= 10.00
  15.         Sasuage= 30.00
  16.         Pineapple= 40.00
  17.         Tax= .15
  18.    
  19. #Pricing for pizza types.
  20.    
  21.         print ("Peporoni is 5.55")
  22.         print ("Mushroom is 10.00")
  23.         print ("Sasuage is 30.00")
  24.         print ("Pineapple is 40.00")
  25.         print ("Tax per person is 15%")
  26.  
  27.         print
  28.    
  29.         numberPizzas = input("How many whole pizzas? ")
  30.         numberPeople = input("Number of People? ")
  31.         typePizza = input("Type of Pizza? ")
  32.         typeDiscountPercent = input("If avaliable, what is the discount percentage? (Number only) ")
  33.         typeDiscountDecimal = typeDiscountPercent / 100
  34.    
  35.         if typeDiscountPercent > 0:
  36.             Totaldiscount= str(((numberPizzas * typePizza) + (numberPeople * Tax)) * (1 - typeDiscountDecimal))
  37.        
  38.         if typeDiscountPercent < 0:
  39.             Total= str((numberPizzas * typePizza) + (numberPeople * Tax))
  40.  
  41.         if typeDiscountPercent > 100:
  42.             print "Error! Only numbers between 0 and 100!"            
  43.            
  44.         else:
  45.             if typeDiscountPercent > 0:
  46.                 print "Total Cost is " + (Totaldiscount)
  47.    
  48.         if typeDiscountPercent < -0:
  49.                print "Error! Only numbers between 0 and 100! Please try Again!"
  50.            
  51.         else:
  52.             if typeDiscountPercent < 0:
  53.                 print "Total Cost is " + (Total)
  54.                
  55.         Reset = raw_input("Do you need to restart? Yes or No ")
  56.  
  57.         if Reset is ("Yes") or ("YES") or ("YEs)" or ("yEs") or ("yeS") or ("Yse") :
  58.            
  59.            
  60.         if Reset is ("no") or ("No") or ("nO") or ("NO") or ("on")
  61.             break
  62.        
  63. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement