function mystery(n)
while n ~= 1 do
if n % 2 == 0 then
n = n / 2
else
n = 3 * n + 1
end
end
print("Stopped at 1")
end
-- call the function
function strange(n)
if n < 0 then
while true do
end
else
print("Done")
end
end
-- call the function
function collatz(n)
while n ~= 1 do
if n % 2 == 0 then
n = n / 2
else
n = 3 * n + 1
end
print(n)
end
print("Reached 1!")
end
-- call the function
-- define main function
function main()
print("Main Function")
-- create lists that will store the order
-- order names, order quantity, order prices
local done = false
local choice = nil
while not done do
print("Menu")
print("R - Restaurant Information")
print("A - Appetizers")
print("E - Entrees")
print("D - Desserts")
print("B - Beverages")
print("P - Place Order")
print("Q - Quit")
io.write("Choice: ")
choice = io.read()
if choice == "R" then
-- call Restaurant Information Function
elseif choice == "A" then
-- call Appetizers Function
elseif choice == "E" then
-- call Entrees Function
elseif choice == "D" then
-- call Desserts Function
elseif choice == "B" then
-- call Beverages Function
elseif choice == "P" then
-- call Place Order Function
elseif choice == "Q" then
print("Quitting!")
done = true
else
print("Invalid Choice")
end
end
end
-- define Restaurant Information Function
-- define Appetizers Function
-- define Entrees Function
-- define Desserts Function
-- define Beverages Function
-- define Place Order Function
-- call main function
main()