AP CSP Unit 3 Quiz 2 PRACTICE

AP CSP Unit 3 Quiz 2 PRACTICE

9th - 12th Grade

8 Qs

quiz-placeholder

Similar activities

Who Is This?

Who Is This?

KG - Professional Development

10 Qs

Python Review 2023-01-12

Python Review 2023-01-12

9th - 12th Grade

10 Qs

Python Arrays

Python Arrays

9th - 12th Grade

13 Qs

Project STEM Computer Science Principles

Project STEM Computer Science Principles

9th - 12th Grade

10 Qs

APCSP BJC Unit 4

APCSP BJC Unit 4

9th - 12th Grade

10 Qs

AP CSP Chapter 4

AP CSP Chapter 4

9th - 12th Grade

10 Qs

AP Computer Science Principles Unit 4 Review

AP Computer Science Principles Unit 4 Review

9th - 12th Grade

8 Qs

Media Player Quiz

Media Player Quiz

12th Grade

10 Qs

AP CSP Unit 3 Quiz 2 PRACTICE

AP CSP Unit 3 Quiz 2 PRACTICE

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Scott Chamberlain

Used 2+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

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.

Media Image
Media Image
Media Image
Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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