0:00

The following method will return `true` if and only if:

```public boolean check(String s) {
return s.length() >= 2 && (s.charAt(0) ==
s.charAt(1) || check(s.substring(1)));
}```

3

Susan is five years older than Matt. Three years from now Susan’s age will be twice Matt’s age. What should be in place of the following condition to solve this problem?

```for (int s = 1; s <=100; s++) {
for (int m = 1; m <= 100; m++) {
if (condition)
System.out.println("Susan is " + s + " and Matt is " + m);
}
}```

4

Assuming that `x` and `y` have been declared as valid integer values, which of the following is equivalent to this statement?

`(x > 15 && x < 18) || (x > 10 || y < 20)`

`(y < 20) || (x > 15 && x < 18)`

3

What would the following print?

```int x = 3;
int y = 2;
if (x > 2) x++;
if (y > 1) y++;
if (x > 2) System.out.print("first ");
if (y < 3) System.out.print("second ");
System.out.print("third");

```

4

What would the following print?

```int x = 3;
int y = 2;
if (y / x > 0)
System.out.print("first ");
System.out.print("second ");```

2