AP CSP Review

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Arnel Dimla
Used 68+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment to the left.
Which of the variables have the value 50 after executing the code segment?
x only
y only
x and z only
x, y, and z
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment to the left.
What is the value of r as a result of executing the code segment?
10
20
30
40
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The variable age is to be used to represent a person’s age, in years. Which of the following is the most appropriate data type for age ?
Boolean
integer
float
string
list
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
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.
Which of the following algorithms displays the correct distance for all possible values of num1 and num2 ?
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.
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.
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.
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.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Three words are stored in the variables word1, word2, and word3. The values of the variables are to be updated as shown in the following table.
Which of the following code segments can be used to update the values of the variables as shown in the table?
temp ← word1
word3 ← word1
word1 ← temp
temp ← word1
word1 ← word3
word3 ← temp
temp ← word1
word1 ← word2
word2 ← word3
word3 ← temp
temp ← word3
word3 ← word2
word2 ← word1
word1 ← temp
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following procedures for string manipulation.
The variable initials is to be assigned a string consisting of the first letter of the string firstName followed by the first letter of the string lastName. Which of the following assigns the correct string to initials ?
initials ← concat(prefix(firstName, 1), prefix(lastName, 1))
initials ← concat(prefix(firstName, 2), prefix(lastName, 2))
initials ← prefix(concat(firstName, lastName), 1)
initials ← prefix(concat(firstName, lastName), 2)
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
To qualify for a particular scholarship, a student must have an overall grade point average of 3.0 or above and must have a science grade point average of over 3.2. Let overallGPA represent a student’s overall grade point average and let scienceGPA represent the student’s science grade point average. Which of the following expressions evaluates to true if the student is eligible for the scholarship and evaluates to false otherwise?
(overallGPA > 3.0) AND (scienceGPA > 3.2)
(overallGPA > 3.0) AND (scienceGPA ≥ 3.2)
(overallGPA ≥ 3.0) AND (scienceGPA > 3.2)
(overallGPA ≥ 3.0) AND (scienceGPA ≥ 3.2)
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Control Structures - Selection in Python

Quiz
•
8th Grade - University
11 questions
recap DIN h446

Quiz
•
12th Grade
10 questions
Python Revision Tour

Quiz
•
12th Grade
14 questions
تقييم درس الجملة الشرطية الكاملة

Quiz
•
10th Grade
9 questions
9. Урок 12+ Принципи тривимірної навігації

Quiz
•
9th Grade
15 questions
C# alapok 2

Quiz
•
11th Grade
12 questions
HTML Javascript

Quiz
•
9th Grade
9 questions
Computer Science Foundations - Module 4 Review

Quiz
•
9th - 11th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade