AP CSP Unit 4 Quiz 1 PRACTICE

AP CSP Unit 4 Quiz 1 PRACTICE

9th - 12th Grade

7 Qs

quiz-placeholder

Similar activities

EMTECH Q3W1 QUIZ 1

EMTECH Q3W1 QUIZ 1

12th Grade

11 Qs

AP CSP Unit 4

AP CSP Unit 4

9th - 12th Grade

10 Qs

Code.org Unit 4 Principles

Code.org Unit 4 Principles

9th - 12th Grade

10 Qs

Website Development - Lesson 2 Retrieval

Website Development - Lesson 2 Retrieval

11th Grade

10 Qs

Website Development 1 - Recall

Website Development 1 - Recall

11th Grade

10 Qs

Emtech 1

Emtech 1

12th Grade

6 Qs

Lesson 1: Information and Communication Technologies

Lesson 1: Information and Communication Technologies

11th - 12th Grade

10 Qs

Fortnite Season 6

Fortnite Season 6

KG - Professional Development

9 Qs

AP CSP Unit 4 Quiz 1 PRACTICE

AP CSP Unit 4 Quiz 1 PRACTICE

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Scott Chamberlain

Used 2+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

"The <missing phrase> structure in Python executes a series of statements continuously for a set number of iterations." Which of the following expressions would best be used in place of <missing phrase> to make the above sentence true?

If

Repeat n times

While

For

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is false?

Scratch is a block-based programming language; therefore, there is no possibility of syntax errors.

Scratch is a drag-and-drop text based programming language; therefore, it introduces the possibility of syntax errors.

Python is a text-based programming language; therefore, it introduces the possibility of syntax errors.

Python allows users to create a wide variety of programs with its text-based programming constructs.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the following Python code print?

46

55

65

Nothing will be printed - the loop never stops.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A programmer completes the user manual for a video game she has developed and realizes she wants to swap the names of two characters, “Shockwave” and “Rain.” She already completed the manual, so she wants to write a program to swap where those names appear in the text.

Consider the programmer’s goal of changing all occurrences of “Shockwave” to “Rain” and all occurrences of “Rain” to “Shockwave.” The programmer will use the fact that the name, “Dreamer” does not appear anywhere in the original text.

Which of the following algorithms can be used to accomplish this?

First, change all occurrences of “Shockwave” to “Dreamer” and then change all occurrences of “Dreamer” to “Rain”.

First, change all occurrences of “Shockwave” to “Dreamer,” then change all occurrences of “Dreamer” to “Rain” and then change all occurrences of “Rain” to “Shockwave”.

First, change all occurrences of “Shockwave” to “Dreamer,” then change all occurrences of “Rain” to “Shockwave” and then change all occurrences of “Dreamer” to “Rain”.

First, change all occurrences of “Shockwave” to “Dreamer,” then change all occurrences of “Dreamer” to “Rain” and then change all occurrences of “Shockwave” to “Rain”.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the following Python code print? You may assume x, y, and z are integers.

The largest of the three numbers x, y, and z

The smallest of the three numbers x, y, and z

The median of the three numbers x, y, and z

The number printed cannot be predicted based on the relative sizes of the three numbers x, y, and z

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following procedures.

What is displayed as a result of executing the following program if fn = Tim, mn = Berners and ln = Lee?

Tim Berners Lee Lee Berners Tim

Lee Berners Tim Tim Berners Lee

Tim Berners Lee Berners Tim

Lee Berners Tim Berners Lee

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an effective way of finding and correcting errors?

Deleting the code segments are restarting that section of code

Posting on a bunch of coding forums online waiting for a coding master to help you

Changing every variable name in your program

Using extra output statements to check values of variable at different points in the program