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
15 questions
Python Programming

Quiz
•
5th Grade - University
15 questions
Search Algorithms and Computational Thinking

Quiz
•
10th Grade
9 questions
Logic Gates

Quiz
•
6th - 12th Grade
5 questions
Programming Day 1

Quiz
•
10th - 12th Grade
5 questions
Topic 2.5 Video 1

Quiz
•
11th Grade
10 questions
SLR 9 - Advanced Programming Techniques - Part Two

Quiz
•
10th Grade
11 questions
Method Review II

Quiz
•
12th Grade
10 questions
Python 3

Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade