What will be the effect on words, a non-empty list of strings, when the following scratch program is run?
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
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 Quizizz
10 questions
Python Review 2023-01-12

Quiz
•
9th - 12th Grade
10 questions
GCSE Computer Science 9-1: Sorting Algorithms

Quiz
•
10th Grade - University
10 questions
HTML Basics

Quiz
•
8th - 10th Grade
10 questions
Search Algorithms

Quiz
•
9th - 12th Grade
10 questions
Sorting Algorithms

Quiz
•
9th - 12th Grade
10 questions
Arrays and Lists

Quiz
•
6th - 12th Grade
11 questions
AP CSP Review 11Q

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

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University