100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

AP CSP Semester 1 Exam Questions And Answers Verified 100% Correct

Rating
-
Sold
-
Pages
36
Grade
A+
Uploaded on
12-05-2025
Written in
2024/2025

AP CSP Semester 1 Exam Questions And Answers Verified 100% Correct In the following code segment, score and penalty are initially positive integers. The code segment is intended to reduce the value of score by penalty. However, if doing so would cause score to be negative, score should be assigned the value 0. For example, if score is 20 and penalty is 5, the code segment should set score to 15.If score is 20 and penalty is 30, score should be set to 0. The code segment does not work as intended. Line 1: IF(score - penalty < 0) Line 2: { Line 3: score ← score - penalty Line 4: } Line 5: ELSE Line 6: { Line 7: score ← 0 Line 8: } Which of the following changes can be made so that the code segment works as intended? - ANSWERS Interchanging lines 3 and 7 Three students in different locations are collaborating on the development of an application. Which of the following strategies is LEAST likely to facilitate collaboration among the students? - ANSWERS Three students in different locations are collaborating on the development of an application. Which of the following strategies is LEAST likely to facilitate collaboration among the students? A student wrote the following code segment, which displays true if the list myList contains any duplicate values and displays false otherwise. The code segment compares pairs of list elements, setting containsDuplicates to true if any two elements are found to be equal in value. Which of the following best describes the behavior of how pairs of elements are compared? - ANSWERS The code segment iterates through myList, comparing each element to all subsequent elements in the list. The following code segment is intended to set max equal to the maximum value among the integer variables x, y, and z. The code segment does not work as intended in all cases. Which of the following initial values for x, y, and z can be used to show that the code segment does not work as intended? - ANSWERS x = 3, y = 2, z = 1 A student is creating an application that allows customers to order food for delivery from a local restaurant. Which of the following is LEAST likely to be an input provided by a customer using the application? - ANSWERS The cost of a food item currently available for order } RETURN(false) } For which of the following contents of myList does the procedure NOT return the intended result? - ANSWERS [-1, 0, 1] A homework assignment consists of 10 questions. The assignment is graded as follows. Number of Correct ANSWERs Grade9-10check plus7-8checkUnder 7check minus Let numCorrect represent the number of correct ANSWERs for a particular student. The following code segment is intended to display the appropriate grade based on numCorrect. The code segment does not work as intended in all cases. For which of the following values of numCorrect does the code segment NOT display the intended grade? Select two ANSWERs. - ANSWERS 8, 6 Which of the following is a true statement about program documentation? - ANSWERS Program documentation is useful during initial program development and also when modifications are made to existing programs. Two grids are shown below. Each grid contains a robot represented as a triangle. Both robots are initially facing left. Each robot can move into a white or gray square, but cannot move into a black region. The following procedure is intended to return true if the list of numbers myList contains only positive numbers and is intended to return false otherwise. The procedure does n ot work as intended. PROCEDURE all Positive(myList) { index ← 1 len ← LENGTH( myList) REPEAT len TIM ES { IF(myList[index] > 0) { RETURN(true) } index ← index + 1 For each grid, the program below is intended to move the robot to the gray square. The program uses the procedure Goal_Reached ( ), which evaluates to true if the robot is in the gray square and evaluates to false otherwise. For which of the grids does the program correctly move the robot to the gray square? - ANSWERS Grid I only A company that develops mobile applications wants to involve users in the software development process. Which of the following best explains the benefit in having users participate? - ANSWERS Users can provide feedback that can be used to incorporate a variety of perspectives into the software. The procedure below is intended to display the index in a list of unique names (nameList) where a particular name (targetName) is found. If targetName is not found in nameList, the code should display 0. Which of the following procedure calls can be used to demonstrate that the procedure does NOT work as intended? - ANSWERS FindName (["Andrea", "Ben", "Chris"], "Ben") A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considerations is LEAST likely to affect the ability of the program to process larger data sets? - ANSWERS How many programming statements the program contains 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? - ANSWERS An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15. Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm? - ANSWERS A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot. A digital photo file contains data representing the level of red, green, and blue for each pixel in the photo. The file also contains metadata that describes the date and geographic location where the photo was taken. For which of the following goals would analyzing the metadata be more appropriate than analyzing the data? - ANSWERS Determining the likelihood that the photo was taken at a particular public event Biologists often attach tracking collars to wild animals. For each animal, the following geolocation data is collected at frequent intervals.

Show more Read less
Institution
AP CSP Semester 1
Course
AP CSP Semester 1











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
AP CSP Semester 1
Course
AP CSP Semester 1

Document information

Uploaded on
May 12, 2025
Number of pages
36
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

AP CSP Semester 1 Exam Questions And Answers
Verified 100% Correct
In the following code segment, score and penalty are initially positive integers. The
code segment is intended to reduce the value of score by penalty. However, if doing so
would cause score to be negative, score should be assigned the value 0.
For example, if score is 20 and penalty is 5, the code segment should set score to 15.If
score is 20 and penalty is 30, score should be set to 0.
The code segment does not work as intended.
Line 1: IF(score - penalty < 0)
Line 2: {
Line 3: score ← score - penalty
Line 4: }
Line 5: ELSE
Line 6: { Line 7:
score ← 0 Line
8: }
Which of the following changes can be made so that the code segment works as
intended? - ANSWERS Interchanging lines 3 and 7

Three students in different locations are collaborating on the development of an
application. Which of the following strategies is LEAST likely to facilitate collaboration
among the students? - ANSWERS Three students in different locations are
collaborating on the development of an application. Which of the following strategies is
LEAST likely to facilitate collaboration among the students?

A student wrote the following code segment, which displays true if the list myList
contains any duplicate values and displays false otherwise.
The code segment compares pairs of list elements, setting containsDuplicates to true if
any two elements are found to be equal in value. Which of the following best describes
the behavior of how pairs of elements are compared? - ANSWERS The code segment
iterates through myList, comparing each element to all subsequent elements in the list.

The following code segment is intended to set max equal to the maximum value among
the integer variables x, y, and z. The code segment does not work as intended in all
cases.
Which of the following initial values for x, y, and z can be used to show that the code
segment does not work as intended? - ANSWERS x = 3, y = 2, z = 1

A student is creating an application that allows customers to order food for delivery from
a local restaurant. Which of the following is LEAST likely to be an input provided by a
customer using the application? - ANSWERS The cost of a food item currently

,available for order

The following procedure is intended to return true if the list of numbers myList contains
only positive numbers and is intended to return false otherwise. The procedure does n ot
work as intended.
PROCEDURE allPositive(myList)
{
index ← 1
len ← LENGTH(myList)
REPEAT len TIMES
{
IF(myList[index] > 0)
{
RETURN(true)
}
index ← index + 1
}
RETURN(false)
}
For which of the following contents of myList does the procedure NOT return the
intended result? - ANSWERS [-1, 0, 1]

A homework assignment consists of 10 questions. The assignment is graded as follows.
Number of
Correct
ANSWERs
Grade9-10check plus7-8checkUnder 7check minus
Let numCorrect represent the number of correct ANSWERs for a particular student.
The
following code segment is intended to display the appropriate grade based on
numCorrect. The code segment does not work as intended in all cases.
For which of the following values of numCorrect does the code segment NOT display
the intended grade?
Select two ANSWERs. - ANSWERS
8, 6

Which of the following is a true statement about program documentation? - ANSWERS
Program documentation is useful during initial program development and also when
modifications are made to existing programs.

Two grids are shown below. Each grid contains a robot represented as a triangle. Both
robots are initially facing left. Each robot can move into a white or gray square, but
cannot move into a black region.

,For each grid, the program below is intended to move the robot to the gray square. The
program uses the procedure Goal_Reached ( ), which evaluates to true if the robot is in
the gray square and evaluates to false otherwise.

For which of the grids does the program correctly move the robot to the gray square? -
ANSWERS Grid I only

A company that develops mobile applications wants to involve users in the software
development process. Which of the following best explains the benefit in having users
participate? - ANSWERS Users can provide feedback that can be used to incorporate
a variety of perspectives into the software.

The procedure below is intended to display the index in a list of unique names
(nameList) where a particular name (targetName) is found. If targetName is not found
in nameList, the code should display 0.

Which of the following procedure calls can be used to demonstrate that the procedure
does NOT work as intended? - ANSWERS FindName (["Andrea", "Ben", "Chris"],
"Ben")

A programmer is writing a program that is intended to be able to process large amounts
of data. Which of the following considerations is LEAST likely to affect the ability of the
program to process larger data sets? - ANSWERS How many programming
statements the program contains

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? - ANSWERS An overflow error
will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15.

Which of the following is an advantage of a lossless compression algorithm over a lossy
compression algorithm? - ANSWERS A lossless compression algorithm can guarantee
reconstruction of original data, while a lossy compression algorithm cannot.

A digital photo file contains data representing the level of red, green, and blue for each
pixel in the photo. The file also contains metadata that describes the date and
geographic location where the photo was taken. For which of the following goals would
analyzing the metadata be more appropriate than analyzing the data? - ANSWERS
Determining the likelihood that the photo was taken at a particular public event

Biologists often attach tracking collars to wild animals. For each animal, the following
geolocation data is collected at frequent intervals.

, The time
The date
The location of the animal
Which of the following questions about a particular animal could NOT be ANSWERed
using only the data collected from the tracking collars? - ANSWERS Do the movement
patterns of the animal vary according to the weather?

An online store uses 6-bit binary sequences to identify each unique item for sale. The
store plans to increase the number of items it sells and is considering using 7-bit binary
sequences. Which of the following best describes the result of using 7-bit sequences
instead of 6-bit sequences? - ANSWERS 2 times as many items can be uniquely
identified.

A video game character can face toward one of four directions: north, south, east, and
west. Each direction is stored in memory as a sequence of four bits. A new version of
the game is created in which the character can face toward one of eight directions,
adding northwest, northeast, southwest, and southeast to the original four possibilities.
Which of the following statements is true about how the eight directions must be stored
in memory? - ANSWERS Four bits are enough to store the eight directions.

A large spreadsheet contains the following information about the books at a bookstore.
A sample portion of the spreadsheet is shown below.
An employee wants to count the number of books that meet all of the following criteria.
Is a mystery book
Costs less than $10.00
Has at least one copy in stock
For a given row in the spreadsheet, suppose genre contains the genre as a string, num
contains the number of copies in stock as a number, and cost contains the cost as a
number. Which of the following expressions will evaluate to true if the book should be
counted and evaluates to false otherwise? - ANSWERS (genre = "mystery") AND ((1 ≤
num) AND (cost < 10.00))

A cable television company stores information about movie purchases made by
subscribers. Each day, the following information is summarized and stored in a publicly
available database.
The day and date each movie was purchased
The title of each movie purchased
The cities where subscribers purchased each movie
The number of times each movie was purchased by subscribers in a given city
A sample portion of the database is shown below. The database is sorted by date and
movie title.
Which of the following CANNOT be determined using only the information in the
database? - ANSWERS The number of movies purchased by an individual subscriber
for a particular month
$14.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
TopGradeGuru
1.5
(2)

Get to know the seller

Seller avatar
TopGradeGuru Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
8
Member since
11 months
Number of followers
0
Documents
2223
Last sold
3 weeks ago
GRADEHUB

We provide access to a wide range of professionally curated exams for students and educators. It offers high-quality, up-to-date assessment materials tailored to various subjects and academic levels. With instant downloads and affordable pricing, it's the go-to resource for exam preparation and academic success.

1.5

2 reviews

5
0
4
0
3
0
2
1
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions