Activity 3.3

Source Code

-- define main function
function main()
    print("Hello Main Function")
    -- create lists



    local choice = nil
    print("Menu")
    print("E1 - Example 1")
    print("Q - Quit")
    io.write("Choice: ")
    choice = io.read()
    if choice == "E1" then
        -- create list

        -- before

        -- Example 1 Function call

        -- after

    elseif choice == "E2" then

    elseif choice == "E3" then
        -- call function

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

-- define printList function

-- define Example 1 Function

-- define Example 2 Function
function example2()
    -- names list

    -- ages list

    -- print the names and corresponding ages

end

-- define Example 3 function


-- call to main function, do not delete!
main()

Last updated

Was this helpful?