I need help writing this program. I need to use Python 3.2 when creating this pr
ID: 3538123 • Letter: I
Question
I need help writing this program. I need to use Python 3.2 when creating this program.
Pricing Program
You have been tasked to write a program to determine the price for an order of pizzas.
The only details you have been given are below:
Use the following math for your pricing program):
Pizza Type
Price
Small Cheese
$5.75 each
Large Cheese
$7.75 each
Small Pepperoni
$6.00 each
Large Pepperoni
$8.00 each
Small Supreme
$8.00 each
Large Supreme
$10.00 each
Sample Functionality:
REQUIREMENTS
Pizza Type
Price
Small Cheese
$5.75 each
Large Cheese
$7.75 each
Small Pepperoni
$6.00 each
Large Pepperoni
$8.00 each
Small Supreme
$8.00 each
Large Supreme
$10.00 each
Explanation / Answer
support.py
def printmenu(): print("select a option"); print("Pizza Type Price "); print("1.Small Cheese $5.75 each"); print("2.Large Cheese $7.75 each "); print("3.Small Pepperoni $6.00 each "); print("4.Large Pepperoni $8.00 each "); print("5.Small Supreme $8.00 each "); print("6.Large Supreme $10.00 each"); print("7.Quit"); def evaluate(a,b): arr=[5.75,7.75,6.00,8.00,8.00,10.00] return arr[a-1]*float(b)
main.py
import sys import support k=1 Billcost=0.0 while(k==1): support.printmenu() print("Your Purchase : $"), print("%.2f"% Billcost) var=raw_input("Enter your Option : "); if (int(var)==7): k=0 else: print("Number : "), number=raw_input() Billcost=Billcost+support.evaluate(int(var),int(number))
support.py
def printmenu(): print("select a option"); print("Pizza Type Price "); print("1.Small Cheese $5.75 each"); print("2.Large Cheese $7.75 each "); print("3.Small Pepperoni $6.00 each "); print("4.Large Pepperoni $8.00 each "); print("5.Small Supreme $8.00 each "); print("6.Large Supreme $10.00 each"); print("7.Quit"); def evaluate(a,b): arr=[5.75,7.75,6.00,8.00,8.00,10.00] return arr[a-1]*float(b)
main.py
import sys import support k=1 Billcost=0.0 while(k==1): support.printmenu() print("Your Purchase : $"), print("%.2f"% Billcost) var=raw_input("Enter your Option : "); if (int(var)==7): k=0 else: print("Number : "), number=raw_input() Billcost=Billcost+support.evaluate(int(var),int(number))
def printmenu(): print("select a option"); print("Pizza Type Price "); print("1.Small Cheese $5.75 each"); print("2.Large Cheese $7.75 each "); print("3.Small Pepperoni $6.00 each "); print("4.Large Pepperoni $8.00 each "); print("5.Small Supreme $8.00 each "); print("6.Large Supreme $10.00 each"); print("7.Quit"); def evaluate(a,b): arr=[5.75,7.75,6.00,8.00,8.00,10.00] return arr[a-1]*float(b) def printmenu(): print("select a option"); print("Pizza Type Price "); print("1.Small Cheese $5.75 each"); print("2.Large Cheese $7.75 each "); print("3.Small Pepperoni $6.00 each "); print("4.Large Pepperoni $8.00 each "); print("5.Small Supreme $8.00 each "); print("6.Large Supreme $10.00 each"); print("7.Quit"); def evaluate(a,b): arr=[5.75,7.75,6.00,8.00,8.00,10.00] return arr[a-1]*float(b) import sys import support k=1 Billcost=0.0 while(k==1): support.printmenu() print("Your Purchase : $"), print("%.2f"% Billcost) var=raw_input("Enter your Option : "); if (int(var)==7): k=0 else: print("Number : "), number=raw_input() Billcost=Billcost+support.evaluate(int(var),int(number))