
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
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
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 Wayground
10 questions
Iteration Practice

Flashcard
•
9th - 12th Grade
6 questions
lists/tuples

Flashcard
•
9th - 12th Grade
10 questions
Arrays

Flashcard
•
10th - 12th Grade
10 questions
Arrays

Flashcard
•
10th - 12th Grade
9 questions
عناوين العمليات بلغة جافا

Flashcard
•
10th Grade - University
9 questions
Unit 4 Lesson 1 While Loops

Flashcard
•
9th - 12th Grade
5 questions
Fundamentals of IT Flashcard 1

Flashcard
•
KG - University
9 questions
Sp3 expresate 3 Ch 3.2 test review - vocabulary/reading

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade