Activity 2.21

Source Code

-- define main function
function main()
    print("Main Function")
    local choice = nil
    print("Menu")
    print("E1 - Example 1")
    print("Q - Quit")
    io.write("Choice: ")
    choice = io.read()
    if choice == "E1" then
        -- call Example 1 Function
        

    elseif choice == "E2" then
        -- call Example 2 Function
        

    elseif choice == "Q" then
        done = true
    else
        print("Invalid Choice")
    end
end

-- define Example 1 Function


-- define Example 2 Function


-- call main function
main()

a221problem1.lua

a221problem2.lua

a221problem3.lua

a221problem4.lua

a221problem5.lua

Last updated

Was this helpful?