AP CSP-Review Session 1 MCQ Quiz

AP CSP-Review Session 1 MCQ Quiz

10th Grade

10 Qs

quiz-placeholder

Similar activities

Arrays

Arrays

10th - 12th Grade

10 Qs

Arrays += Chan

Arrays += Chan

9th - 12th Grade

12 Qs

AP CSP:  Interpreting Algorithms / Block Programming Language

AP CSP: Interpreting Algorithms / Block Programming Language

9th - 12th Grade

14 Qs

Java Math

Java Math

9th - 12th Grade

15 Qs

CodeHS - Java Console Review

CodeHS - Java Console Review

8th - 10th Grade

12 Qs

AP CSA 4.2 (For Loops)

AP CSA 4.2 (For Loops)

10th - 12th Grade

10 Qs

29W Quiz 1 - PLTW

29W Quiz 1 - PLTW

8th - 12th Grade

15 Qs

Pseudocode CSP

Pseudocode CSP

10th - 12th Grade

8 Qs

AP CSP-Review Session 1 MCQ Quiz

AP CSP-Review Session 1 MCQ Quiz

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Thomas Harris

Used 5+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?