Training high school teachers to teach AP Computer Science Principles
Select Page
Programming Quiz
Results
#1 What is the output of the following code segment?
True!
Verified!
True!Verified!
#2 What is the output of the following code segment?
This is our store! Books section. Pens section. Thank you for visiting!
This is our store! Thank you for visiting!
This is our store! Pens section. Books section. Thank you for visiting!
This is our store! Pens section. Thank you for visiting!
#3 How does the array ‘a’ look like after executing the following code segment? (a.length represents the length of the array)
{11, 3, 3, 19, 23, 17}
{11, 3, 4, 20, 23, 18}
{10, 2, 4, 20, 22, 18}
{18, 22, 20, 4, 2, 10}
#4 Which of the following is not a reserved keyword in java?
main
if
void
public
#5 What is the output of this code?
Hi there!
Hi there!Thank you!
Thank you!
Error: non-static method director() cannot be referenced from a static context
#6 What is the result of the above code segment when executed?
It throws an error because x is always greater than ‘0’
It enters infinite loop
It runs for some time and halts
The output is 11
#7 Are both the outputs of code segment (i) and code segment (ii) equal?
Yes, output of (i) and (ii) are same
No, output of (i) differs from output of (ii)
Syntax of (i) is correct and (ii) is incorrect
Syntax of (i) is incorrect and (ii) is correct
#8 Consider the following code segment where ‘f’ is a function that is defined as shown below. What value is returned by the function call f ( 30 , 100 ) ?
100
0
30
Can't be determined
#9 What is the output of the following program?
Touch screen available! iphone
Touch screen not available! Samsung TV
Touch screen available! iphone Touch screen not available! Samsung TV
Touch screen not available! Samsung TV Touch screen available! iphone
#10 What is the output of the following code segment?