Question

In: Computer Science

Users may order one or more pizzas, where each pizza may be either: small, medium or...

Users may order one or more pizzas, where each pizza may be either: small, medium or large. Small pizzas cost $5, medium pizzas cost $8 and large pizzas cost $12. All pizzas come on a tomato base (for our pizza shop, this will be the only option), and will have the topping cheese by default, at no extra cost. Users may choose up to a maximum of four additional toppings (bringing the total to five) from the following list, where each topping adds an additional $1 to the price of the pizza:  Bacon,  Olives,  Ham,  Mushrooms, ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 2 of 4  Pineapple,  Salami,  Anchovies. A pizza order consists of an order for one or more pizzas, where each pizza has a size, and may optionally include a list of up to four additional toppings. Each pizza order must be marked as either to be collected or to be delivered. If the pizza is to be collected then the order requires a name and a phone number to be valid. If the pizza is to be delivered then a name, phone number and address are required to be valid. In addition, if the order total is less than $30 then an $8 delivery fee is added to the total. The application must be error tolerant and capable of accepting keyboard input to store a number of pizza orders in memory (they do not have to be persisted to file), as well as displaying an order summary which include details of all orders, including:  The details of each pizza in the order,  The total cost of the order, and  The name, phone number and (if required) address of the person who made the order. Program code in LISP ?

Solutions

Expert Solution

Source Code:

from _operator import add
class Pizza :
def __init__(self, size,topping,orderType):
self.size = size
self.topping = topping
self.orderType = orderType
  
  
if __name__ == '__main__':
pizzaList = []
number = int(input("how many pizza ? "))
for i in range(0,number):
print("Please enter details for pizza : ",i+1)
size = input("pizza size Small Medium or Large [s,m,l] ? ")
topping = input("do you want extra topping [y,n] ? ")
toppingList = []
if topping=='y' or topping=='Y':
print("Please choose topping from the list")
bacon = input("Bacon [y,n] ? ")
if bacon=='y' or bacon=='Y':
toppingList.append("Bacon")
  
Olives = input("Olives [y,n] ? ")
if Olives=='y' or Olives=='Y':
toppingList.append("Olives")
  
Ham = input("Ham [y,n] ? ")
if Ham=='y' or Ham=='Y':
toppingList.append("Ham")
  
Mushrooms = input("Mushrooms [y,n] ? ")
if Mushrooms=='y' or Mushrooms=='Y':
toppingList.append("Mushrooms")
  
if len(toppingList)!=4:
Pineapple = input("Pineapple [y,n] ? ")
if Pineapple=='y' or Pineapple=='Y':
toppingList.append("Pineapple")
if len(toppingList)!=4:   
Salami = input("Salami [y,n] ? ")
if Salami=='y' or Salami=='Y':
toppingList.append("Bacon")
if len(toppingList)!=4:   
Anchovies = input("Anchovies [y,n] ? ")
if Anchovies=='y' or Anchovies=='Y':
toppingList.append("Anchovies")
  
orderType = input("Order will be collected or delivered [c,d] ? ")
myPizza = Pizza(size,toppingList,orderType)
pizzaList.append(myPizza)
  
tempCost = 0;
needDelivery = False
totalCost = 0;
for pizza in pizzaList :
if pizza.size=='s':
print("Pizza size : Small")
tempCost+=5;
elif pizza.size=='m':
print("Pizza size : Medium")
tempCost+=8;
elif pizza.size=='l':
print("Pizza size : Large")
tempCost+=12;
  
  
if len(pizza.topping)!=0:
tempCost+=len(pizza.topping);
print("Pizza has following extra topping")
for name in pizza.topping:
print(name,end=" ");
print()
if(pizza.orderType=='c'):
print("Pizza will be collected")
else:
print("Pizza will be delivered")
needDelivery = True
print("Pizza costs : ",tempCost)
totalCost+=tempCost;
print("------------------------------------------")
  
if needDelivery and totalCost<30:
print("Adding delivery charges $8")
totalCost+=8;
  
  
print("\nYour total bill is : ",totalCost)
name = input("Enter your name : ")
phoneNumber = input("Enter your phone number : ")
if needDelivery:
address = input("Enter your address : ")
  
  
print("Thank you "+name+" for choosing us")
if needDelivery:
print("Your pizza will be delivered at : "+address)
  

Output:

If you have any doubts, feel free to ask

Happy learning


Related Solutions

Three pizza places share market for pizzas in a small city. Demand for pizzas is given...
Three pizza places share market for pizzas in a small city. Demand for pizzas is given by Q(p)=4200 - 200p where p - price of pizza and Q is total number of pizzas. Marginal cost of production of pizza is $3 for chain A, $4 for chain B and $5 for chain C. Each has a fixed cost of $3000/week. Due to a combination of economic downtown and local lost of population in the city, the chains find themselves with...
A pizza place is having a special: 10 medium pizzas for $50. They only allow you...
A pizza place is having a special: 10 medium pizzas for $50. They only allow you to choose one of their 6 different specialty pizzas though, with no substitutions. You and 6 friends are having a get-together (so 7 people altogether), and you decide to order pizza for the group. Each person gets to choose one type of pizza, and then you are responsible for choosing the remaining 3. Once all 7 people have chosen their pizza, how many total...
Your local pizzeria is having a special offer on medium pizzas. The first pizza will cost...
Your local pizzeria is having a special offer on medium pizzas. The first pizza will cost you $10, but if you buy a second pizza it will only cost you $5. What aspect of consumer theory does this illustrate? Explain why a rational consumer does not spend all of her income buying only her favourite product. a) Suppose that Daniel is willing to pay a maximum of $5 for his first slice of pizza. For each additional slice, he would...
Language: Java Crust : A small pizza costs $5.99, a medium is $7.99, and a large...
Language: Java Crust : A small pizza costs $5.99, a medium is $7.99, and a large is $9.99. A handtossed crust is an additional $0.50, and a deep dish pan crust is an additional $1.00. Do a CrustSize enum [S(5.99), M(7.99), and L(9.99)] and a CrustType enum [THIN(0.00), HAND(0.50), and PAN(1.00)]. Place your enums in CrustEnum.java. Both enums should have cost methods. Do a Crust class with a constructor that accepts and sets the crust size and type, and provide...
Write one page where ti descbribe a Value chain for dominos pizza where to describe each...
Write one page where ti descbribe a Value chain for dominos pizza where to describe each step and also compare with other company in same industry
- Where receptive fields are small, they are served by more OR fewer (choose one) receptors...
- Where receptive fields are small, they are served by more OR fewer (choose one) receptors in that region. Where receptive fields are small, you are more OR less (choose one) sensitive? - Which of the following is NOT one of the steps of sensory processing? Choose one a. transduction of the signal b. transmission of the signal to the integrating center c. perception of the stimulus at the integrating center d. motor response to the signal Thank you so...
There is a small place that makes pizza produces three goods (bread, cheese, and pizza), each...
There is a small place that makes pizza produces three goods (bread, cheese, and pizza), each produced by a separate company. The bread and cheese companies produce all the inputs they need to make bread and cheese, respectively. The pizza company uses the bread and cheese from the other companies to make its pizzas. All three companies employ labour to help produce their goods, and the difference between the value of goods sold and the sum of labour and input...
Writte one page where to discribe Value system for Domino’s pizza to describe each step of...
Writte one page where to discribe Value system for Domino’s pizza to describe each step of value system
Milano Pizza Club owns three identical restaurants popular for their specialty pizzas. Each restaurant has a...
Milano Pizza Club owns three identical restaurants popular for their specialty pizzas. Each restaurant has a debt–equity ratio of 30 percent and makes interest payments of $55,000 at the end of each year. The cost of the firm’s levered equity is 15 percent. Each store estimates that annual sales will be $1.58 million; annual cost of goods sold will be $810,000; and annual general and administrative costs will be $545,000. These cash flows are expected to remain the same forever....
Milano Pizza Club owns three identical restaurants popular for their specialty pizzas. Each restaurant has a...
Milano Pizza Club owns three identical restaurants popular for their specialty pizzas. Each restaurant has a debt–equity ratio of 30 percent and makes interest payments of $47,000 at the end of each year. The cost of the firm’s levered equity is 22 percent. Each store estimates that annual sales will be $1.42 million; annual cost of goods sold will be $730,000; and annual general and administrative costs will be $465,000. These cash flows are expected to remain the same forever....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT