AP CSP Unit 3 Quiz 2 PRACTICE

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Scott Chamberlain
Used 2+ times
FREE Resource
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
8.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What value does the following code segment display?
20
26
30
No value is ever displayed because the algorithm repeats the REPEAT UNTIL block indefinitely
Similar Resources on Wayground
10 questions
Year 10 - Spreadsheets 2

Quiz
•
10th Grade
10 questions
PNG60403 TOPIC 4.4

Quiz
•
10th Grade
11 questions
AP CSP Review 11Q

Quiz
•
10th - 12th Grade
10 questions
Introduction to Database

Quiz
•
10th Grade
10 questions
L.8. STRINGS AND STRING MANIPULATION -1

Quiz
•
12th Grade
6 questions
Creating Playlists and Document Skills

Quiz
•
9th Grade
9 questions
Linguagem de programação: Criando projetos artísticos com Javasc

Quiz
•
9th Grade
7 questions
Higher Standard Algorithms

Quiz
•
11th 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
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th 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