APCSP Big Idea 3 Review

APCSP Big Idea 3 Review

10th - 12th Grade

8 Qs

quiz-placeholder

Similar activities

AP CSP Booleans

AP CSP Booleans

9th - 12th Grade

10 Qs

AP CSP Robot

AP CSP Robot

9th - 12th Grade

10 Qs

Boolean Logic

Boolean Logic

9th - 12th Grade

10 Qs

2.1 Algorithms and Computational Thinking

2.1 Algorithms and Computational Thinking

8th - 11th Grade

10 Qs

Fundamentals of Algorithms

Fundamentals of Algorithms

10th Grade

10 Qs

Understanding Bubble Sort Algorithm

Understanding Bubble Sort Algorithm

12th Grade

10 Qs

Key Terms Python

Key Terms Python

12th Grade

10 Qs

PLTW CSE L1 Vocab P2/2

PLTW CSE L1 Vocab P2/2

9th - 12th Grade

10 Qs

APCSP Big Idea 3 Review

APCSP Big Idea 3 Review

Assessment

Quiz

Computers

10th - 12th Grade

Hard

Created by

Amy Austin

Used 18+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

When the problem can be solved in a reasonable time and an approximate solution is acceptable

When the problem can be solved in a reasonable time and an exact solution is needed

When the problem cannot be solved in a reasonable time and an approximate solution is acceptable

When the problem cannot be solved in a reasonable time and an exact solution is needed

2.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

A sorted list of numbers contains 500 elements. Which of the following is closest to the maximum number

of list elements that will be examined when performing a binary search for a value in the list?

10

50

250

500

3.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Media Image

Consider the code segment in the picture.

If the variables onTime and absent both have the value false, what is displayed as a result of running the

code segment?

Is anyone there?

Better late than never.

Hello. Is anyone there?

Hello. Better late than never.

4.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Media Image

Consider the following program code.

Which of the following best describes the result of running the program code?

The number 0 is displayed.

The number 6 is displayed.

The number 10 is displayed

Nothing is displayed; the program results in an infinite loop.

5.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

Media Image

An office building has two floors. A computer program is used to control an elevator that travels between

the two floors. Physical sensors are used to set the following Boolean variables.(In the picture)

The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on.

Which of the following Boolean expressions can be used in a selection statement to cause the elevator to

move?

(onFloor1 AND callTo2) AND (onFloor2 AND callTo1)

(onFloor1 AND callTo2) OR (onFloor2 AND callTo1)

(onFloor1 OR callTo2) AND (onFloor2 OR callTo1)

(onFloor1 OR callTo2) OR (onFloor2 OR callTo1)

6.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

A list of numbers has n elements, indexed from 1 to n. The following algorithm is intended to display

the number of elements in the list that have a value greater than 100. The algorithm uses the variables

count and position. Steps 3 and 4 are missing.

Step 1: Set count to 0 and position to 1.

Step 2: If the value of the element at index position is greater than 100, increase the value of

count by 1.

Step 3: (missing step)

Step 4: (missing step)

Step 5: Display the value of count.

Which of the following could be used to replace steps 3 and 4 so that the algorithm works as intended?

Step 3:

Increase the value of position by 1.

Step 4:

Repeat steps 2 and 3 until the value of count is greater than 100

Step 3:

Increase the value of position by 1.

Step 4:

Repeat steps 2 and 3 until the value of position is greater than n

Step 3:

Repeat step 2 until the value of count is greater than 100.

Step 4:

Increase the value of position by 1

Step 3:

Repeat step 2 until the value of position is greater than n.

Step 4: Increase the value of count by 1

7.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

The following procedure is intended to return the number of times the value val appears in the list

myList. The procedure does not work as intended.

Which of the following changes can be made so that the procedure will work as intended?

Changing line 6 to IF(item = count

Changing line 6 to IF(myList[item] = val)

Moving the statement in line 5 so that it appears between lines 2 and 3

Moving the statement in line 11 so that it appears between lines 9 and 10

8.

MULTIPLE CHOICE QUESTION

10 mins • 1 pt

There are 32 students standing in a classroom. Two different algorithms are given for finding the average

height of the students.

Algorithm A

Step 1: All students stand.

Step 2: A randomly selected student writes his or her height on a card and is seated.

Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new

value on the card, and is seated. The previous value on the card is erased.

Step 4: Repeat step 3 until no students remain standing.

Step 5: The sum on the card is divided by 32. The result is given to the teacher.

Algorithm B

Step 1: All students stand.

Step 2: Each student is given a card. Each student writes his or her height on the card.

Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their

cards and writes the result on one student’s card; the other student is seated. The previous value on the card

is erased.

Step 4: Repeat step 3 until one student remains standing.

Step 5: The sum on the last student’s card is divided by 32. The result is given to the teacher.

Which of the following statements is true?

Algorithm A always calculates the correct average, but Algorithm B does not

Algorithm B always calculates the correct average, but Algorithm A does not.

Both Algorithm A and Algorithm B always calculate the correct average.

Neither Algorithm A nor Algorithm B calculates the correct average.