0%
0 votes, 0 avg
28

This quiz randomly generates 20 questions as asked in AP Computer Science A (AP CSA) - Programming in Java.

Congratulations!

(AP CSA) - Programming in Java

AP Computer Science A (AP CSA) - Programming in Java

This quiz randomly generates 20 questions (in 30 mins) as asked in AP Computer Science A (AP CSA) - Programming in Java.

1 / 20

What output will be produced by invoking secondTestMethod for a Tester object, assuming that testArray contains 3, 4, 5?

2 / 20

Question

3 / 20

What is the output?
public static void main(String[] args) {
int a = (int)(1 * Math.random());
int b = (int)(1 * Math.random());
if (a > b && a > c)
   System.out.println(a);
else if (b > a && b > c)
   System.out.println(b);
else
   System.out.println(c);
}

4 / 20

What is the output?

5 / 20

Question

6 / 20

Question

7 / 20

What is the output?

8 / 20

What is the output?

9 / 20

What is the output?

10 / 20

What is the length of the myIntegers array initialized in the code below?
int a = 8;
a *= 2;
a = a * 3 / 5;
int[] myArray = new int[a];
for(int i = 0; i < myArray.length; i++) {
myArray[i] = i % 4;
}

11 / 20

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter "G" is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table below.
A-65
B-66
C-67
D-68
ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the 8-bit binary value: 0100 0010

12 / 20

Question

13 / 20

Which assertion is true just before each execution of the while loop?

14 / 20

What is the result of the following expression in Java?

15 / 20

8 bits is enough to represent 256 different numbers. How many total bits do you need to represent 512 (twice as many) numbers?

16 / 20

Which of the following expressions is equivalent to !(x < 5 && y >= 10)?

17 / 20

Question

18 / 20

What will the array arr look like after the following loop finishes?

19 / 20

What is the output?

 

20 / 20

Question

Which of the following is a false statement about the methods?

Your score is

0%

Scroll to Top