Activity 2.20

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 1 Function twice
        

    elseif choice == "E3" then
        -- call Example 3 Function


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

-- define Example 1 Function


-- define Example 3 Function


-- call main function
main()

a220problem1.lua

a220problem2.lua

a220problem3.lua

a220problem4.lua

a220problem5.lua

Last updated

Was this helpful?