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?
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. 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 Quizizz
15 questions
AP CSP Exam Review: Big Idea 3

Quiz
•
8th - 10th Grade
12 questions
Compound Operators in Java

Quiz
•
9th - 12th Grade
10 questions
Java Coding

Quiz
•
9th - 12th Grade
8 questions
AP CSP Unit 3 Simple Review

Quiz
•
9th - 12th Grade
10 questions
SIK Lessons 3-9

Quiz
•
9th - 12th Grade
10 questions
APCSA Unit 4

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

Quiz
•
9th - 12th Grade
10 questions
AP CSA Unit 1 & 2 Review

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
20 questions
Understanding Linear Equations and Slopes

Quiz
•
9th - 12th Grade