Project 4

Source Code

-- define main function
function main()
    print("Main Function")
    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 Entrees Function


-- define Desserts Function


-- define Beverages Function


-- define Place Order Function


-- call main function
main()

Last updated

Was this helpful?