Conditionals Review

Conditionals Review#

These questionss are designed to asssess your current understanding of conditionals!

public static void mystery(int n) {
    System.out.print(n + " ");

    if (n < 0) {
        n = n + 7;
    } else {
        n = n * 2;
    }
    
    System.out.println(n);
}

Consider the following method. For each call below, indicate what output is produced.

Questions 1

mystery(8)


Questions 2

mystery(-3)


Questions 3

mystery(1)


Questions 4

mystery(0)