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
10 questions
String and Math Methods AP CSA

Quiz
•
10th Grade
8 questions
Question Type: Pseudocode

Quiz
•
10th - 12th Grade
14 questions
C++ - Loops and Random Numbers

Quiz
•
9th - 12th Grade
10 questions
Arrays

Quiz
•
10th - 12th Grade
10 questions
Variables in C++

Quiz
•
9th - 12th Grade
14 questions
AP CSP: Interpreting Algorithms / Block Programming Language

Quiz
•
9th - 12th Grade
15 questions
Java Math

Quiz
•
9th - 12th Grade
10 questions
AP CSA 4.2 (For Loops)

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
10 questions
Essential Lab Safety Practices

Interactive video
•
6th - 10th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade