Popcorn Hack 1




Popcorn Hack 2




Homework Hack 1

  1. Predict Output: What will this print?
    System.out.print("AP ");
    System.out.println("CSA");
    System.out.println("Rocks!");
    
  2. Fix the Bug: The following is supposed to print C:\Users\Student, but it fails. Correct it:
    System.out.println("C:\Users\Student");
    
  3. Menu Hack: Add a 4th option (Settings) to Menu.java and update optionCount accordingly.

  4. Challenge: Use System.out.printf to print pi with 2 decimals.
    System.out.printf("Pi = %.2f\n", Math.PI);
    

Homework Hack 2

  • Expand Menu.java into a calculator menu:
    1. Print a menu with options: Add, Subtract, Multiply, Divide.
    2. Ask the user for two numbers.
    3. Use arithmetic expressions to compute and display the result.
    4. Example run: ``` ==== Calculator Menu ====
      1. Add
      2. Subtract
      3. Multiply
      4. Divide Choose an option: 1 Enter first number: 10 Enter second number: 5 Result: 15 ```

Homework Hack 3 Game

Here is the game that you will also be playing, to test your understanding of the lesson. You will screenshot the game score and submit it to the 1.3 google form (this will alos include 1.4 content, submission is for both)

1.3 and 1.4 Game