Session 15

Source Code

print("Session 15")

-- initialize done to false
local done = false

-- sentinel controlled while loop
while not done do
    -- Menu Options
    print("Menu")
    print("E1 - Example 1")
    print("Q - Quit")
    io.write("Choice: ")
    local choice = io.read()

    if choice == "E1" then
        print("Example 1")
        -- add code here


    elseif choice == "E2" then
        print("Example 2")
        -- add code here


    elseif choice == "E3" then
        print("Example 3")
        -- add code here


    elseif choice == "E4" then
        print("Example 4")
        -- add code here

                
    elseif choice == "E5" then
        print("Example 5")
        -- add code here
        

    elseif choice == "E6" then
        print("Example 6")
        -- add code here
        
 
    elseif choice == "E7" then
        print("Example 7")
        -- add code here
        
 
    elseif choice == "E8" then
        print("Example 8")
        -- add code here
        
        
    elseif choice == "E9" then
        print("Example 9")
        -- add code here
        
    elseif choice == "E10" then
        print("Example 10")
        -- add code here
        

    -- Q condition
    elseif choice == "Q" then
        print("Quit!")
        done = true
    -- else condition
    else
        print("Invalid choice")
    end
end

s15problem1.lua

s15problem2.lua

s15problem3.lua

s15problem4.lua

s15problem5.lua

s15problem6.lua

s15problem7.lua

s15problem8.lua

s15problem9.lua

s15problem10.lua

s15problem11.lua

s15problem12.lua

Project 3

Last updated

Was this helpful?