Home Quizzes Quiz Detail
Practice Quiz

AP Computer Science Unit 1 - Test Review Practice Questions

20 questions 5.0 rating Mobile friendly
$69.00

Unlock the full practice quiz

Get complete access to the questions, explanations and printable quiz resources.

Full access: unlock all quiz questions and explanations.
Printable review: access the full quiz PDF with correct answers after purchase.

About this Exam

Prepare with the AP Computer Science Unit 1 - Test Review Practice Questions practice quiz. This question bank includes 20 questions covering value, count, code, segment, and expression. Use it to review important concepts, identify knowledge gaps, and build confidence for the related exam, course, or assessment.

Sample Questions

Question 1
Consider this code segment: int x = 10, y = 0; while (x > 5) { y = 3; while (y < x) { y *= 2; if (y % x == 1) y += x; } x -= 3; } System.out.println(x + " " + y); What will be output after execution of this code segment?
a > b and b > 0
7 12
111101bin
x = 30 y = 90
Explanation:
Correct answer: 7 12
Question 2
In Java, a variable of type int is represented internally as a 32-bit signed integer. Suppose that one bit stores the sign, and the other 31 bits store the magnitude of the number in base 2. In this scheme, what is the largest value that can be stored as type int ?
x = 30 y = 90
12
#0E14FF
231 − 1
Explanation:
Correct answer: 231 − 1
Question 3
A common use of hexadecimal numerals is to specify colors on web pages. Every color has a red, green, and blue component. In decimal notation, these are denoted with an ordered triple (x, y, z), where x, y, and z are the three components, each an int from 0 to 255. For example, a certain shade of red, whose red, green, and blue components are 238, 9, and 63, is represented as (238, 9, 63). In hexadecimal, a color is represented in the format #RRGGBB, where RR, GG, and BB are hex values for the red, green, and blue. Using this notation, the color (14, 20, 255) would be coded as #RRGGBB. Which of the following hex codes represents the color (14, 20, 255)?
x = 30 y = 90
statement2, but not statement1, will be executed
#0E14FF
a > b and b > 0
Explanation:
Correct answer: #0E14FF
Question 4
Suppose that base-2 (binary) numbers and base-16 (hexadecimal) numbers can be denoted with subscripts, as shown below: 2Ahex = 101010bin Which is equal to 3Dhex ?
111101bin
88881 bin
122211 bin
133321 bin
Explanation:
Correct answer: 111101bin
Question 5
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?
c < a is false.
I only
There is round-off error in calculating the pow and sqrt functions.
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.

Ready to test your knowledge?

Buy Now to Access

Additional Information

AP Computer Science Unit 1 - Test Review Practice Questions

This practice set contains 20 questions from the matching question bank and focuses on value, count, code, segment, and expression. Work through each question carefully, review the provided solutions, and revisit topics that need more study before your next attempt.

This is an independent study resource intended for practice and review; it is not an official examination or an endorsement by any organization named in the title.

Frequently Asked Questions

This quiz contains a total of 20 practice questions carefully selected to test your knowledge on this subject.
Yes, you will have exactly 0 minutes to complete the exam. A countdown timer will be visible once you start.
Yes, you can retake this practice test as many times as you need. The questions and options may be randomized on subsequent attempts to ensure comprehensive learning.

Reviews

5.0

Based on 0 reviews

Leave a Review

No reviews yet. Be the first to review!