Week 18

Source Code

local myName = ""
print("Name: " .. myName)

-- define main function
function main()
    print("Hello Main Function")
    print(myName)
    local done = false
    local choice = nil
    while not done do
        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 == "E3" then
            -- call Example 3 Function


        elseif choice == "E4" then
            -- call Example 4 Function


        elseif choice == "E5" then
            -- call Example 5 Function
            

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

-- define Example 1 Function


-- define Example 2 Function


-- define Example 3 Function


-- define Example 4 Function


-- define Example 5 Function


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

College Project

-- Main Function
function main()
    print("College Research Project")
    local done = false
    local choice = nil
    while not done do
        print("Menu")
        print("C - College Name")
        print("L - Loan Calculator")
        print("Q - Quit")
        io.write("Choice: ")
        choice = io.read()
        if choice == "C" then

        elseif choice == "L" then

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

-- define tuition Function
function tuition()

end

-- define housing Function
function housing()

end

-- define fees Function
function fees()

end

-- define loan calculator Function
function loanCalculator()

end

-- call main function
main()

Last updated