Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Exercise 1: public static void foo (boolean a) boolean b false; bar (a, b) boole

ID: 3585970 • Letter: E

Question

Exercise 1: public static void foo (boolean a) boolean b false; bar (a, b) boolean d = true ; soo(d, "d") public static void main (String[] args) foo (true) foo (false) System.out.print ("All done!") public static void bar (boolean a, boolean b) if (a && b) System.out.println ("a and b are true") else if (a) ( else if (b) ( else System.out.println ("a is true") System. out.println ("b is true" System.out.println ("a and b are false") boolean c false soo (c, "c") public static void soo (boolean e, String variableName) if (e) System.out.println (variableName+ "is true") else ( System.out.println (variableName+ "is false")

Explanation / Answer

The output of the above code is as follows:

a is true

c is false

d is true

a and b are false

c is false

d is true