Question Two (4 marks): Consider the following methods: public static int secret(int x) { int i, j; i = 2 * x; if( i > 10) j = x/2; else j = x/3; return j – 1; public static int another (int a, int b) { int i, j = 0; for (i = a; i <= b; i++) j = j + i; return j; What is the output of each of the following program segments? Output: Statements in main method: x = 10; System.out.println (secret (x)); x = 5, y = 8; System.out.println(another (x, y)); x = 10; k = secret (x); System.out.println(another (x, k)); x = 5; y = 8 System.out.println(another (y,x)); Show transcribed image text Question Two (4 marks): Consider the following methods: public static int secret(int x) { int i, j; i = 2 * x; if( i > 10) j = x/2; else j = x/3; return j – 1; public static int another (int a, int b) { int i, j = 0; for (i = a; i

## Expert Answer

Answer to Question Two (4 marks): Consider the following methods: public static int secret(int x) { int i, j; i = 2 * x; if( i > 1…