Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?
APCSP Big Idea 3 Review

Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Amy Austin
Used 18+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
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
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
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
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.
Similar Resources on Quizizz
10 questions
algortihm cs

Quiz
•
10th Grade
10 questions
Unit 1 Review AP CSP

Quiz
•
9th - 12th Grade
10 questions
Introduction to programming

Quiz
•
5th - 10th Grade
13 questions
A words - GCSE Computer Science

Quiz
•
1st - 10th Grade
10 questions
COMP SCI Unit 2 #7

Quiz
•
11th Grade
12 questions
Computer Science

Quiz
•
3rd - 12th Grade
10 questions
Search Algorithms

Quiz
•
9th - 12th Grade
10 questions
AP CSP Boolean Logic 3

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
20 questions
Understanding Linear Equations and Slopes

Quiz
•
9th - 12th Grade