Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 45 – 90 seconds per question. Determine the output for each question. PreAP Computer Science Output Quiz 05
Title the quiz as shown below The quiz starts in ONE minute. Name Period Date Output Quiz EC.
What is the output of this program? public class Question01 { public static void main(String args[]) { for (int k = 1; k <= 10; k++) System.out.print(k + " "); } (a) (b) (c) (d)
What is the output of this program? public class Question02 { public static void main(String args[]) { for (int k = 1; k < 10; k++) System.out.print(k + " "); } (a) (b) (c) (d)
What is the output of this program? public class Question03 { public static void main(String args[]) { for (int k = 0; k <= 10; k+=2) System.out.print(k + " "); } (a) (b) (c) (d)
What is the output of this program? public class Question04 { public static void main(String args[]) { for (int k = 1; k <= 10; k+=2) System.out.print(k + " "); } (a) (b) (c) (d)
What is the output of this program? public class Question05 { public static void main(String args[]) { for (int k = 3; k < 50; k*=2) System.out.print(k + " "); } (a) (b) (c) (d)
What is the output of this program? public class Question06 { public static void main(String args[]) { for (int k = 12345; k >= 10; k /= 10) System.out.print(k + " "); } (a) (b) (c) (d)
What is the output of this program? public class Question07 { public static void main(String args[]) { double x = 3.5; if (x < 5.0) System.out.println("EXPO"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question08 { public static void main(String args[]) { double x = 7.5; if (x < 5.0) System.out.println("EXPO"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question09 { public static void main(String args[]) { char c = 'J'; c++; if (c == 'J') System.out.println("EXPO"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question10 { public static void main(String args[]) { char c = 'K'; c--; if (c == 'J') System.out.println("EXPO"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question11 { public static void main(String args[]) { double x = 3.5; if (x < 5.0) System.out.println("EXPO"); else System.out.println("JAVA"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question12 { public static void main(String args[]) { double x = 7.5; if (x < 5.0) System.out.println("EXPO"); else System.out.println("JAVA"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question13 { public static void main(String args[]) { double x = 2.9; if (x > 2.9) System.out.println("EXPO"); else System.out.println("JAVA"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question14 { public static void main(String args[]) { double x = 2.9; if (x >= 2.9) System.out.println("EXPO"); else System.out.println("JAVA"); } (a) EXPO (b) JAVA (c) EXPOJAVA (d) No output
What is the output of this program? public class Question15 { public static void main(String args[]) { int x,y; x = y = 10; x++; y += x; x *= 2; System.out.println(x – y); } (a) 43(b) 22(c) 21 (d) 11(e) 1(f) -1
What is the output of this program? public class Question16 { public static void main(String args[]) { int x,y; x = y = 10; y++; x += y; y *= 2; System.out.println(y + x); } (a) 43(b) 22(c) 21 (d) 11(e) 1(f) -1
What is the output of this program? public class Question17 { public static void main(String args[]) { int x = 5; while (x <= 10) x++; System.out.println(x); } (a) 5 (b) 7(c) 9 (d) 10(e) 11(f) 12
What is the LAST output of this program? public class Question18 { public static void main(String args[]) { int x = 5; while (x < 10) { x+=2; System.out.println(x); } (a) 5 (b) 7(c) 9 (d) 10(e) 11(f) 12
What is the output of this program? public class Question19 { public static void main(String args[]) { int x = 20; int y = 2; int z = 3; while (x > y + z) { x--; y += z; z += y; } System.out.println(z); } (a) 5(b) 13(c) 18(d) 21
What is the flag in this program? public class Question20 { public static void main(String args[]) { int x = 0; while (x >= 0) x = Expo.enterInt(); } (a)0 (b)any positive number (c)any positive number and 0 (d)any negative number
public class ExtraCredit { public static void main(String args[]) { int sum = 0; for (int k = 1 ; k <= 10; k++) k = k + k; System.out.println(sum); } (a)0 (b)10 (c)14 (d)16 (e)20 (f)32