Day 1
Day 2
Day 3
Debugging 1
Debugging 2
100
Line of code needed to use Scanner and Random class.

What is import java.util.Scanner/Random?

100

This programming style is based on the concept of “objects” that contain data and methods.

What is object-oriented programming?

100

This is the process of finding and fixing problems in a Java program.

What is debugging?

100

public static void main(String[] args) {
        System.out.printl("Hello, world!");

}

System.out.println("Hello, world!");

the n is missing

100

public static void main(String[] args) {
        int result = add(5, 3);
        System.out.println(result);
    }

    public static void add(int a, int b) {
        return a + b;
    }

return type is wrong for add() method
200

This statement is used to display text in the console.

What is System.out.println?

200

These are values sent into a method to customize its behavior.

What are parameters?

200

This Java feature lets the user choose between options, like a menu.

What is a switch statement?

200

public static void main(String[] args) {
        int name = "John";
        System.out.println(name);
    }

String name = "John";

int should be String

200

switch (choice) {
  case 1:
    System.out.println("You chose 1");
  case 2:
    System.out.println("You chose 2");
  default:
    System.out.println("Default choice");
}

missing break; for each case

300

These are containers for storing data values such as numbers or text.

What are variables?

300

This type of operator combines boolean expressions, like &&, ||, and !.

What are boolean operators?

300

This kind of loop is designed to iterate through each element in a collection or array.

What is a for-each loop?

300

public static void main(String[] args) {
        Scanner scanner;
        System.out.print("Enter your age: ");
        int age = scanner.nextInt();
        System.out.println("You are " + age + " years old.");
    }

Scanner scanner = new Scanner(System.in);

300

public static void main(String[] args) {
        String password = "1234";
        if (password == "1234") {
            System.out.println("Access granted");
        }
    }

if (password.equals("1234")) {

400

This type of statement allows a program to make decisions based on conditions.

What is an if statement?

400

These are special methods used to create and initialize objects.

What are constructors?

400

These are events where something goes wrong during the execution of a program, often requiring special handling.

What are exceptions?

400

public static void main(String[] args) {
        int i = 0;
        while (i < 5) {
            System.out.println("i is: " + i);
        }
    }

add i ++; at the end of the loop

400

public static void main(String[] args) {
        return;
        System.out.println("This will never print.");
    }

unreachable code
either remove return; or move it to the end

500

This operator is used to combine strings or add numbers.

What is the + operator?

500

This structure holds multiple values in a single variable, using an index.

What is an array?

500

This data structure organizes data in rows and columns, like a grid.

What is a two-dimensional array?

500

public static void main(String[] args) {
        int[] numbers = {1, 2, 3};
        System.out.println(numbers[3]);
    }

index 3 does not exist

500

public class Player {
    int health;
    public Player() {
        health = 100;
    }
    public void printHealth() {
        System.out.println("Health: " + health);
    }
}
public class Game {
    public static void main(String[] args) {
        Player.printHealth();
    }
}

In the Game class should have:
Player p = new Player();
p.printHealth();

M
e
n
u