> For the complete documentation index, see [llms.txt](https://www.csprinciples.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csprinciples.com/25-26/session-17.md).

# Session 17

## Source Code

```lua
print("Session 17")

-- define main function
function main()
    print("Main Function")
    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 == "E6" then
            -- call Example 6 Function
            

        elseif choice == "E7" then
            -- call Example 7 Function
            
            
        elseif choice == "E8" then
            -- call Example 8 Function
            
            
        elseif choice == "E9" then
            -- call Example 9 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


-- define Example 6 Function


-- define Example 7 Function


-- define Example 8 Function


-- define Example 9 Function


-- call main function
main()
```

## s17problem1.lua

```lua
-- main function
function main()
    -- call problem1 function

end

-- problem1 function definition


-- call to main function
main()
```

## s17problem2.lua

```lua
-- main function
function main()
    -- call problem2 function

end

-- problem2 function definition


-- call to main function
main()
```

## s17problem3.lua

```lua
-- main function
function main()
    -- call problem3 function

end

-- problem3 function definition


-- call to main function
main()
```

## s17problem4.lua

```lua
-- main function
function main()
    -- call problem4 function

end

-- problem4 function definition


-- call to main function
main()
```

## s17problem5.lua

```lua
-- main function
function main()
    -- call problem5 function

end

-- problem5 function definition


-- call to main function
main()
```

## s17problem6.lua

```lua
-- main function
function main()
    -- call problem6 function

end

-- problem6 function definition


-- call to main function
main()
```

## s17problem7.lua

```lua
-- main function
function main()
    -- call problem7 function

end

-- problem7 function definition


-- call to main function
main()
```

## s17problem8.lua

```lua
-- main function
function main()
    -- call problem8 function

end

-- problem8 function definition


-- call to main function
main()
```

## s17problem9.lua

```lua
-- main function
function main()
    -- call problem9 function

end

-- problem9 function definition


-- call to main function
main()
```

## s17problem10.lua

```lua
-- main function
function main()
    -- call problem10 function

end

-- problem10 function definition


-- call to main function
main()
```

## s17problem11.lua

```lua
-- main function
function main()
    -- call problem11 function

end

-- problem11 function definition


-- call to main function
main()
```

## s17problem12.lua

```lua
-- main function
function main()
    -- call problem12 function

end

-- problem12 function definition


-- call to main function
main()
```

## Project 4

```lua
print("Project 4")
print("Name: ")

-- define main function
function main()
    print("Main Function")
    local done = false
    local choice = nil
    while not done do
        print("Menu")
        print("R - Restaurant Information")
        print("A - Appetizers")
        print("E - Entrees")
        print("D - Desserts")
        print("B - Beverages")
        print("P - Place Order")
        print("Q - Quit")
        io.write("Choice: ")
        choice = io.read()
        if choice == "R" then
            -- call Restaurant Information Function


        elseif choice == "A" then
            -- call Appetizers Function


        elseif choice == "E" then
            -- call Entrees Function


        elseif choice == "D" then
            -- call Desserts Function


        elseif choice == "B" then
            -- call Beverages Function


        elseif choice == "P" then
            -- call Place Order Function


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

-- define Restaurant Information Function


-- define Appetizers Function


-- define Entrees Function


-- define Desserts Function


-- define Beverages Function


-- define Place Order Function


-- call main function
main()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.csprinciples.com/25-26/session-17.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
