Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

AP COMPUTER SCIENCE PRINCIPLES - SEMESTER 1 FINAL REVIEW QUESTIONS WITH VERIFIED ANSWERS LATEST UPDATE 2026

Beoordeling
-
Verkocht
-
Pagina's
68
Cijfer
A+
Geüpload op
26-01-2026
Geschreven in
2025/2026

AP COMPUTER SCIENCE PRINCIPLES - SEMESTER 1 FINAL REVIEW QUESTIONS WITH VERIFIED ANSWERS LATEST UPDATE 2026 C - Answers A certain programming language uses 4-bit binary sequences to represent nonnegative integers. For example, the binary sequence 0101 represents the corresponding decimal value 5. Using this programming language, a programmer attempts to add the decimal values 14 and 15 and assign the sum to the variable total. Which of the following best describes the result of this operation? A The correct sum of 29 will be assigned to the variable total. B An overflow error will occur because 4 bits is not large enough to represent either of the values 14 or 15. C An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15. D A round-off error will occur because the decimal values 14 and 15 are represented as approximations due to the fixed number of bits used to represent numbers. B - Answers Suppose a large group of people in a room were all born in the same year. Consider the following three algorithms, which are each intended to identify the people in the room who have the earliest birthday based on just the month and day. For example, a person born on February 10 is considered to have an earlier birthday than a person born on March 5. Which of the three algorithms will identify the correct people? All the people in the room stand up. All standing people form pairs where possible, leaving at most one person not part of a pair. For each pair, the person with the earlier birthday remains standing, while the other person in the pair sits down. If there is a tie, both people sit down. Any individual not part of a pair remains standing. Continue doing this until only one person remains standing. That person has the earliest birthday. All the people in the room stand up. All standing people form pairs with another standing person that they have not previously been paired with where possible, leaving at most one person not part of a pair. For each pair, the person with the earlier birthday remains standing

Meer zien Lees minder
Instelling
AP COMPUTER SCIENCE PRINCIPLES
Vak
AP COMPUTER SCIENCE PRINCIPLES

Voorbeeld van de inhoud

AP COMPUTER SCIENCE PRINCIPLES - SEMESTER 1 FINAL REVIEW QUESTIONS WITH VERIFIED
ANSWERS LATEST UPDATE 2026



C - Answers A certain programming language uses 4-bit binary sequences to represent
nonnegative integers. For example, the binary sequence 0101 represents the corresponding
decimal value 5. Using this programming language, a programmer attempts to add the decimal
values 14 and 15 and assign the sum to the variable total. Which of the following best describes
the result of this operation?



A

The correct sum of 29 will be assigned to the variable total.

B

An overflow error will occur because 4 bits is not large enough to represent either of the values
14 or 15.

C

An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14
and 15.

D

A round-off error will occur because the decimal values 14 and 15 are represented as
approximations due to the fixed number of bits used to represent numbers.

B - Answers Suppose a large group of people in a room were all born in the same year. Consider
the following three algorithms, which are each intended to identify the people in the room who
have the earliest birthday based on just the month and day. For example, a person born on
February 10 is considered to have an earlier birthday than a person born on March 5. Which of
the three algorithms will identify the correct people?

All the people in the room stand up. All standing people form pairs where possible, leaving at
most one person not part of a pair. For each pair, the person with the earlier birthday remains
standing, while the other person in the pair sits down. If there is a tie, both people sit down.
Any individual not part of a pair remains standing. Continue doing this until only one person
remains standing. That person has the earliest birthday.

All the people in the room stand up. All standing people form pairs with another standing
person that they have not previously been paired with where possible, leaving at most one

,person not part of a pair. For each pair, the person with the earlier birthday remains standing,
while the other person in the pair sits down. If there is a tie, both people in the pair remain
standing. Any individual not part of a pair remains standing. Continue doing this until only one
person remains standing or all persons standing have the same birthday. Anyone still standing
has the earliest birthday.

Beginning with the number 1, ask if anyone was born on that day of any month. Continue with
the numbers 2, 3, and so on until a positive response is received. If only one person responds,
that person has the earliest birthday. If more than one person responds, determine which
person was born in the earliest month, and that person or those persons have the earliest
birthday.

A

I only

B

II only

C

I and

B - Answers A student is creating an algorithm to display the distance between the numbers
num1 and num2 on a number line. The following table shows the distance for several different
values.

Value of num1Value of num2Distance Between num1 and num2523187-347

Which of the following algorithms displays the correct distance for all possible values of num1
and num2 ?



A

Step 1:Add num1 and num2 and store the result in the variable sum. Step 2: Take the absolute
value of sum and display the result.

B

Step 1:Subtract num1 from num2 and store the result in the variable diff.Step 2:Take the
absolute value of diff and display the result.

C

,Step 1:Take the absolute value of num1 and store it in the variable absNum1.Step 2:Take the
absolute value of num2 and store it in the variable absNum2.Step 3:Add absNum1 and
absNum2 and display the result.

D

Step 1:Take the absolute value of num1 and store it in the variable absNum1.Step 2:Take the
absolute value of num2 and store it in the variable absNum2.Step 3:Subtract absNum1 from
absNum2 and display the result.

B - Answers A certain game keeps track of the maximum and minimum scores obtained so far. If
num represents the most recent score obtained, which of the following algorithms correctly
updates the values of the maximum and the minimum?

A

If num is greater than the minimum, set the minimum equal to num. Otherwise, if num is
greater than the maximum, set the maximum equal to num.

B

If num is less than the minimum, set the minimum equal to num. Otherwise, if num is greater
than the maximum, set the maximum equal to num.

C

If num is less than the minimum, set the minimum equal to num. Otherwise, if num is less than
the maximum, set the maximum equal to num.

D

If num is greater than the minimum, set the minimum equal to num. Otherwise, if num is less
than the maximum, set the maximum equal to num.

B - Answers The figure below shows four grids, each containing a robot represented as a
triangle. The robot cannot move to a black square or move beyond the edge of the grid.

Which of the following algorithms will allow the robot to make a single circuit around the
rectangular region of black squares, finishing in the exact location and direction that it started in
each of the four grids?



Step 1:Keep moving forward, one square at a time, until the square to the right of the robot is
black.Step 2:Turn right and move one square forward.Step 3:Repeat steps 1 and 2 three more
times.

, B

Step 1:Keep moving forward, one square at a time, until the square to the right of the robot is
no longer black.Step 2:Turn right and move one square forward. Step 3: Repeat steps 1 and 2
three more times.

C

Step 1:Move forward three squares.Step 2:Turn right and move one square forward.Step 3: If
the square to the right of the robot is black, repeat steps 1 and 2.

D

Step 1:Move forward three squares.Step 2:Turn right and move one square forward.Step 3:If the
square to the right of the robot is not black, repeat steps 1 and 2.

D - Answers A programmer is creating an algorithm that will be used to turn on the motor to
open the gate in a parking garage. The specifications for the algorithm are as follows.

The gate should not open when the time is outside of business hours.

The motor should not turn on unless the gate sensor is activated.

The motor should not turn on if the gate is already open.

Which of the following algorithms can be used to open the gate under the appropriate
conditions?



A

Check if the time is outside of business hours. If it is, check if the gate sensor is activated. If it is,
check if the gate is closed. If it is, turn on the motor.

B

Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is,
check if the gate is open. If it is, turn on the motor.

C

Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is not,
check if the gate is open. If it is not, turn on the motor.

D

Geschreven voor

Instelling
AP COMPUTER SCIENCE PRINCIPLES
Vak
AP COMPUTER SCIENCE PRINCIPLES

Documentinformatie

Geüpload op
26 januari 2026
Aantal pagina's
68
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$11.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
joshuawesonga22 Liberty University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
97
Lid sinds
1 jaar
Aantal volgers
1
Documenten
14118
Laatst verkocht
2 dagen geleden
Tutor Wes

Hi there! I'm Tutor Wes, a dedicated tutor with a passion for sharing knowledge and helping others succeed academically. All my notes are carefully organized, detailed, and easy to understand. Whether you're preparing for exams, catching up on lectures, or looking for clear summaries, you'll find useful study materials here. Let’s succeed together!

3.9

9 beoordelingen

5
4
4
1
3
3
2
1
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen