What is the result of the following AP pseudocode? You may assume that the isPrime procedure accepts a whole number and returns Boolean true if the number is prime and Boolean false if the number is composite.
n ← 0
primes ← []
REPEAT UNTIL(n > 100)
{
IF(isPrime(n))
{
APPEND(primes, n)
}
n ← n + 1

AP CS Principles Algorithms & Programming

Flashcard
•
Computers
•
9th Grade - University
•
Hard
Quizizz Content
FREE Resource
Student preview

8 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
The primes list contains all of the prime numbers from 0 to 100.
2.
FLASHCARD QUESTION
Front
What does the following AP pseudocode procedure do?
PROCEDURE mystery(num)
{
IF(num MOD 2 = 0)
{
RETURN(true)
}
ELSE
{
RETURN(false)
}
}
Back
Returns true if the num argument is an even number; returns false otherwise.
3.
FLASHCARD QUESTION
Front
Smyth County Public Schools' Director of Transportation is trying to figure out bus routes for the coming school year. He wants to minimize miles traveled, while still picking up all students who request bus transport. What kind of solution is he likely to use?
Back
A heuristic approach that comes up with a reasonable set of routes that is not necessarily the most optimal solution.
4.
FLASHCARD QUESTION
Front
True or False: there are certain problems that cannot be solved algorithmically.
Back
True
5.
FLASHCARD QUESTION
Front
When measuring the efficiency of an algorithm, is the growth rate of the number of moves required to solve the Towers of Hanoi problem (which grows exponentially) considered reasonable or unreasonable?
Back
Unreasonable
6.
FLASHCARD QUESTION
Front
What kind of coding error occurs if a program using Zeller's Congruence incorrectly determines that Feb. 29, 2021 fell on a Monday? Options: Syntactical error, Run-time error, Logic error, Overflow error
Back
Logic error
7.
FLASHCARD QUESTION
Front
A problem for which no algorithm can be constructed that will provide a correct answer for every set of inputs is called:
Back
An undecidable problem
8.
FLASHCARD QUESTION
Front
What is the output of this circuit which is composed of two logic gates?
Back
True
Similar Resources on Quizizz
10 questions
Arrays

Flashcard
•
10th - 12th Grade
7 questions
Central Limit Theorem Review

Flashcard
•
11th - 12th Grade
11 questions
Java Boolean Statements

Flashcard
•
11th Grade
11 questions
Futebol

Flashcard
•
KG - Professional Dev...
13 questions
Functions and Parameters

Flashcard
•
9th - 12th Grade
9 questions
Chapter 6 Vocabulary-Percents

Flashcard
•
KG
8 questions
IF Statements

Flashcard
•
12th Grade
6 questions
lists/tuples

Flashcard
•
9th - 12th Grade
Popular Resources on Quizizz
10 questions
Chains by Laurie Halse Anderson Chapters 1-3 Quiz

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
15 questions
Character Analysis

Quiz
•
4th Grade
12 questions
Multiplying Fractions

Quiz
•
6th Grade
30 questions
Biology Regents Review #1

Quiz
•
9th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function

Quiz
•
9th - 12th Grade
Discover more resources for Computers
30 questions
Biology Regents Review #1

Quiz
•
9th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function

Quiz
•
9th - 12th Grade
20 questions
Taxes

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

Quiz
•
9th - 12th Grade
14 questions
Attributes of Linear Functions

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

Quiz
•
KG - University
50 questions
Biology Regents Review 2: Ecology

Quiz
•
9th - 12th Grade