> For the complete documentation index, see [llms.txt](https://www.precollege.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.precollege.net/session-6/source-code.md).

# Source Code

## Session6.java

```java
import java.util.*;

public class Session6 {
    public static void main(String[] args) {
        String myName = ""; // add your name
        System.out.println("Session 6" + " - " + myName);

        // Menu
        System.out.println("Menu");
        System.out.println("E1 - Example 1");
        System.out.println("Q  - Quit");

        // setup Scanner
        Scanner in = new Scanner(System.in);
        System.out.print("Choice: ");
        String choice = in.nextLine();

        // switch choices
        switch (choice) {
            case "E1":
                System.out.println("Example 1");
                example1();
                break;
            case "E2":
                System.out.println("Example 2");
                example2();
                break;
            case "E3":
                System.out.println("Example 3");
                example3();
                break;
            case "E4":
                System.out.println("Example 4");
                example4();
                break;
            case "E5":
                System.out.println("Example 5");
                example5();
                break;
            case "E6":
                System.out.println("Example 6");
                example6();
                break;
            case "E7":
                System.out.println("Example 7");
                example7();
                break;
            case "Q":
                System.out.println("Quitting..!");
                break;
            default:
                System.out.println("Invalid Choice");
        }
    }

    // example1 method
    public static void example1() {

    }

    // example2 method
    public static void example2() {

    }

    // example3 method
    public static void example3() {
        // create array
        

        // save first value
        

        // loop
       
            // if it's not the last element, copy the next one over


        // print
 

    }

    // example4 method
    public static void example4() {

    }

    // example5 method
    public static void example5() {
        // create 2d array

        // print 2D array via deepToString

        // print the number of rows

        // print the number of columns

        // print using nested for loops

    }

    // example6 method
    public static void example6() {
        // declare constants

        // create 2D array named seatingChart

        // initialize the array elements

        // print the array elements

        // print the rows and columns

        // using nested for loops, print the elements

    }

    // example7 method
    public static void example7() {
        int[][] grid = {
                { 1, 2, 3 },
                { 4, 5, 6 },
                { 7, 8, 9 }
        };

    }
}
```

## CommandLineArgs.java

```java
public class CommandLineArgs {
    public static void main(String[] args) {
        System.out.println("Number of arguments: " + args.length);
        for (int i = 0; i < args.length; i++) {
            System.out.println("Argument " + i + ": " + args[i]);
        }
    }
}
```

## CommandLineExample.java

```java
public class CommandLineExample {
    public static void main(String[] args) {
        int num1 = Integer.parseInt(args[0]);
        int num2 = Integer.parseInt(args[1]);
        int sum = num1 + num2;
        System.out.println("Sum: " + sum);
    }
}
```


---

# 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, and the optional `goal` query parameter:

```
GET https://www.precollege.net/session-6/source-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
