Docsity

Pizza Restaurant Homework: Number Analysis and Revenue Calculation, Exams of Programming Languages

Toggle sidebar
bg1
Homework week 7:
Exercise 1. Write code that meets the following requirements:
• Enter a 2-digit number and then write that digit in Vietnamese. ex: 11→ mười một, 55→ năm mươi
lăm….
• If the number is not 2 digits, re-enter is required
• Stops only when user enters “exit” or “end”.
Here is a list of orders from a pizza restaurant on Monday:
Exercise 2. a) Recount the number of pizzas ordered by the customer's name (ex: Nam: 'chicken', 'medium',
'thin': 2,….).
b) Suppose that the number of toppings on the chicken pizza is only 20. Remind customers to order another when
this pizza topping runs out.
Exercise 3. The number of pizzas prepared on Monday by the restaurant according to the table below
Toppings
small
medium
large
chicken
chorio
beef
cheese
20
20
20
20
35
35
30
Remind customers to order another dish when the ordered pizza runs out.
Exercise 4. a) Sizes sell pizza prices: small: $4, $6, and large: $12. Calculate the total revenue of the restaurant
on Monday.
b) The cost for a small pizza is $2, a medium one is $3, a large one is $5, and $100 for other expenses. Calculate
restaurant profit on Monday.

Partial preview of the text

Download Pizza Restaurant Homework: Number Analysis and Revenue Calculation and more Exams Programming Languages in PDF only on Docsity!

Homework week 7 :

Exercise 1. Write code that meets the following requirements:

  • Enter a 2-digit number and then write that digit in Vietnamese. ex: 11→ mười một, 55→ năm mươi lăm….
  • If the number is not 2 digits, re-enter is required
  • Stops only when user enters “exit” or “end”. Here is a list of orders from a pizza restaurant on Monday:

Exercise 2. a) Recount the number of pizzas ordered by the customer's name (ex: Nam: 'chicken', 'medium',

'thin': 2,….). b) Suppose that the number of toppings on the chicken pizza is only 20. Remind customers to order another when this pizza topping runs out.

Exercise 3. The number of pizzas prepared on Monday by the restaurant according to the table below

Toppings small medium large chicken chorio beef cheese pineapple 20 20 20 20 20 35 35

Remind customers to order another dish when the ordered pizza runs out.

Exercise 4. a) Sizes sell pizza prices: small: $4, $6, and large: $12. Calculate the total revenue of the restaurant

on Monday. b) The cost for a small pizza is $2, a medium one is $3, a large one is $5, and $100 for other expenses. Calculate restaurant profit on Monday.