AP CSP-Review Session 1 MCQ Quiz

Quiz
•
Computers
•
10th Grade
•
Hard
Thomas Harris
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A numeric test score is to be converted to a letter grade of A, B, or C according to the following rules: A score greater than 90 is considered an A; a score between 80 and 90, inclusive, is considered a B; and any other score is considered a C. Which of the following code segments will assign the correct letter grade to grade based on the value of the variable score?
A. II only
B. I and II only
C. I and III only
D. II and III only
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the above procedure, assume that the parameter x is an integer. Which of the following best describes the behavior of the procedure?
A. It displays nothing if x is negative and displays true otherwise.
B. It displays nothing if x is negative and displays false otherwise.
C. It displays true if x is negative and displays nothing otherwise.
D. It displays true if x is negative and displays false otherwise.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A student wrote the code segment above, 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?
The code segment iterates through myList, comparing each element to all other elements in the list.
The code segment iterates through myList, comparing each element to all subsequent elements in the list.
The code segment iterates through myList, comparing each element to the element that immediately follows it in the list.
The code segment iterates through myList, comparing each element to the element that immediately precedes it in the list.
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
A homework assignment consists of 10 questions. The assignment is graded using the chart to the right. Let numCorrect represent the number of correct answers for a particular student. The code segment to the left 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 values of numCorrect does the code segment NOT display the intended grade? Select TWO answers.
A. 9
B. 8
C. 7
D. 6
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the code segment shown, 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. The code segment does not work as intended. Which of the following changes can be made so that the code segment works as intended?
A. Changing line 1 to IF(score < 0)
B. Changing line 1 to IF(score + penalty < 0)
C. Changing line 7 to score ← score + penalty
D. Interchanging lines 3 and 7
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code segment above. p ← 10 q ← 20 r ← 30 s ← 40 p ← q q ← r s ← q r ← p What is the value of r as a result of executing the code segment?
A. 10
B. 20
C. 30
D. 40
7.
MULTIPLE CHOICE QUESTION
30 sec • 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 table below: | Variable | Value Before Updating | Value After Updating | |----------|----------------------|---------------------| | word1 | "xylophone" | "zebra" | | word2 | "yarn" | "yarn" | | word3 | "zebra" | "xylophone" | Which of the following code segments can be used to update the values of the variables as shown in the table?
A. temp ← word1 word3 ← word1 word1 ← temp
B. temp ← word1 word1 ← word3 word3 ← temp
C. temp ← word1 word1 ← word2 word2 ← word3 word3 ← temp
D. temp ← word3 word3 ← word2 word2 ← word1 word1 ← temp
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Java Strings

Quiz
•
9th - 12th Grade
10 questions
Computer Languages

Quiz
•
KG - University
10 questions
Code.org Unit 5 Vocab Quiz 1

Quiz
•
9th - 12th Grade
15 questions
1.2 - Characters

Quiz
•
9th - 10th Grade
14 questions
1.8. Open Source & Proprietary software

Quiz
•
10th Grade
10 questions
Python Lists

Quiz
•
9th - 12th Grade
10 questions
Unit 1 Review AP CSP

Quiz
•
9th - 12th Grade
12 questions
HTML & CSS

Quiz
•
10th - 12th 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
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