0% found this document useful (0 votes)
32 views

Repitition Structures - Drawio

The document describes a food ordering system with a menu and order processing functionality. It defines variables to track the order, menu items and costs, gets user input for items and quantities, calculates totals, and displays an order summary. The system uses a while loop to repeatedly get orders until the user indicates they are done, tracking the running total and individual orders in lists.

Uploaded by

jamesdedase07
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Repitition Structures - Drawio

The document describes a food ordering system with a menu and order processing functionality. It defines variables to track the order, menu items and costs, gets user input for items and quantities, calculates totals, and displays an order summary. The system uses a while loop to repeatedly get orders until the user indicates they are done, tracking the running total and individual orders in lists.

Uploaded by

jamesdedase07
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Start A

Declare Sales_tax = 0.10 Display SALES TAX AMOUNT,


sales_Tax_amount

Set total = saleSubtotal + salesTax_amount


Display "Enter the price of the six items"

Input "Price of the six items" Display Total Purchase, total

Set salesubtotal = item1 + item2 + item3 + item4


End
+ item5 + item6

Display 'Salesubtotal', salesubtotal

Set salesTax_amount = saleSubtotal *


salesTax

A
Start

counter = 0

While True DISPLAY "Do you want to order?"

INPUT order_complete

DISPLAY "Do while loop: counter is, counter

counter += 1

order_complete != yes

End
Start

counter = 0

While True DISPLAY "Enter your allowance"

INPUT allowance

DISPLAY Do-Until Loop:


Counter is, counter

counter += 1

False
if counter == 5

True

END
Start

Module time

DECLARE
counter = 10

time.sleep(1)
while count <= 100:
Delay 1 sec

DISPLAY "Hacking NASA , count.....")

END

count += 10
Start

DISPLAY "Enter the numbers of students:"

INPUT students

DECLARE grades = []
DECLARE firstnames = []

for i in range(students):
DISPLAY Enter your First Name
Loop based on the input of STUDENTS

INPUT firstname

END

DISPLAY "Enter your grade"

firstname added to the firstnames list

firstnames.append(firstname)

grade added to the grades list

grades.append(grade)
START

student_grades = {
'student1': {'Laboratory1': 90, 'Laboratory2': 85, 'Midterm': 88},
'student2': {'Laboratory1': 78, 'Laboratory2': 92, 'Midterm': 80},....

for student, grades in student_grades.items(): DISPLAY Student: ,student")

for subject, score in grades.items():

END

DISPLAY ",subject ,score")


food_ordering
Start

DECLARE order_complete = False


Module DECLARE total_purchased = []
food_ordering

END

DISPLAY
while not order_complete:
Do you want to order? (yes/no):

INPUT ask

True
DISPLAY ("Thank you for your order!") if ask.lower() != "yes":

False

DISPLAY("Welcome to the Food Ordering System!")


# Display the menu
Return DISPLAY("Menu:")
DISPLAY ("1. Turon - Php 5.00")
DISPLAY ("2. Bananacue - Php 8.00")
DISPLAY ("3. Maruya - Php 7.00")
DISPLAY ("4. Chicken Beryani - Php 90.00")
DISPLAY ("5. Buko Juice - Php 17.00")

DISPLAY Enter the number of the item you want to order:

A
A

item = "Turon"
if choice == 1
cost = 5.00

item = "Bananacue" How many {item}s


elif choice == 2
cost = 8.00 do you want to order?

INPUT quantity

item = "Maruya"
elif choice == 3
cost = 7.00

total_cost = cost *
quantity

total_purchased.append((item, quantity,
total_cost))

item = "Chicken Beryani"


elif choice == 4
cost = 90.00

DISPLAY
You have ordered {quantity} {item}(s) for a total
cost of ${total_cost:.2f}."

DISPLAY
item = "Buko Juice"
elif choice == 5 Do you want to place another order?
cost = 17.00
(yes/no):

B
DISPLAY
A
Invalid choice. Please select a valid item from the menu.
B

if True
another_order.lower() A
!= "yes":

DISPLAY
Summary of Purchases

DISPLAY(f"{order[1]} {order[0]}(s) for a


for order in total_purchased:
total cost of Php{order[2]:.2f}")

DISPLAY Your total order cost is: Php{sum(order[2] for


order in total_purchased):.2f}

DISPLAY Thank you for your order!

Return

You might also like