
AP CSP Unit 3 Quiz 2 PRACTICE
Authored by Scott Chamberlain
Computers
9th - 12th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the effect on words, a non-empty list of strings, when the following scratch program is run?
The strings in words will be duplicated so each one appears twice
The order of the strings in words will be reversed
The strings in words will be sorted into alphabetical order
Nothing will change: the list words will be identical to its previous state before the program was run
2.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
The contents of list are initially a, b, e. Which of the following code fragments would change the contents of list to be a, b, c, d, e? Select two answers.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following would not be considered an example of abstraction?
Creating a list of integers named myList and referring to this in the code of a program rather than writing the list each time it is used
Using a procedure (custom block) which swaps the values of two variables input as parameters rather than writing code to swap the blocks each time
Writing machine code rather than using a high-level programming language to program a chip to behave in a certain way
Writing binary numbers to represent the states of various switches and lights in a digital circuit
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A programmer completes the user manual for a video game she has developed and realizes she has reversed the roles of “goats” and “sheep” throughout the text. Consider the programmer’s goal of changing all occurrences of “goats” to “sheep” and all occurrences of “sheep” to “goats.” The programmer will use the fact that the word “foxes” does not appear anywhere in the original text. Which of the following algorithms can be used to accomplish this?
First, change all occurrences of “goats” to “sheep”, and then change all occurrences of “sheep” to “goats”
First, change all occurrences of “goats” to “sheep,” then change all occurrences of “sheep” to “foxes” and then change all occurrences of “foxes” to “goats”
First, change all occurrences of “goats” to “foxes,” then change all occurrences of “sheep” to “goats” and then change all occurrences of “foxes” to “sheep”
First, change all occurrences of “goats” to “foxes,” then change all occurrences of “foxes” to “sheep” and then change all occurrences of “sheep” to “goats”
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What would the list moreLetters contain after the following code segment is run?
M, N, O, P, Q
M, N, O, P, Q, A, D
A, M, N, D, O, P, Q
M, N, O, P, Q, A, B, C, D, E
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Assuming the list ints contains exactly 10 values, what would happen when the script below is run?
The sprite would say “0”
The sprite would say the item at number 1 on the list ints
The sprite would say the item at number 10 on the list ints
The sprite would say nothing
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The procedure EditPlaylist, shown below, is intended to allow a user to edit the contents of the list playlist. Which of the following best describes the behavior of this procedure when it is run and the values 3 and Bohemian Rhapsody are entered in that order? (You may assume that the length of playlist is greater than 4)
The item at index 3 on playlist is replaced with the item Bohemian Rhapsody, and the length of the list does not change
The item Bohemian Rhapsody is inserted at index 3 on playlist and all subsequent items in playlist are shifted one position lower, causing the length of the list to increase by 1
The item at index 3 on playlist is removed, and then the item previously at index 4 (now at index 3) is replaced with the item Bohemian Rhapsody, meaning the length of the list is decreased by 1
No changes are made to the contents of playlist
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Printers
Quiz
•
9th - 12th Grade
10 questions
python
Quiz
•
10th Grade
10 questions
DTJSQuiz
Quiz
•
11th Grade
10 questions
Treasure Hunt
Quiz
•
12th Grade
10 questions
Initial Assessment - Cybersecurity Awareness
Quiz
•
9th Grade - Professio...
10 questions
TMK TAHUN 6
Quiz
•
10th - 12th Grade
10 questions
Greetings
Quiz
•
1st Grade - University
10 questions
DATA STRUCTURES
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade