AP Computer Science Unit 1 – Test Review Practice Questions

Access More Questions
The following fragment intends that a user will enter a list of positive integers at the keyboard and terminate the list with a sentinel: int value = 0; final int SENTINEL = -999; while (value != SENTINEL) { //code to process value ... value = IO.readInt(); //read user input } The fragment is not correct. Which is a true statement?
Correct Answer:
The code will always process a value that is not on the list.
Explanation:
Correct answer: The code will always process a value that is not on the list.

Access more questions from this quiz

Continue to AP Computer Science Unit 1 – Test Review Practice Questions for more practice questions and the full quiz experience.

Access More Questions