
AP CS Principles Algorithms & Programming
Quiz
•
Computers
•
9th Grade - University
•
Medium
Terry Hawthorne
Used 2+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the result of running the following AP pseudocode?
remainder 15 MOD 2
DISPLAY(remainder + 13 * 2)
28
1
27
41
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
}
The primes list contains all of the integers from 0 to 100.
The primes list contains all of the prime numbers from 0 to 100.
An infinite loop results.
The program terminates with an error because the ELSE clause is missing.
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What does the following AP pseudocode procedure do?
PROCEDURE mystery(num)
{
IF(num MOD 2 = 0)
{
RETURN(true)
}
ELSE
{
RETURN(false)
}
}
Returns true if the num argument is an even number; returns false otherwise.
Displays "num is even" or "num is odd", depending on what value is passed to it.
Terminates in an error.
Returns true if the num argument is an odd number; returns false otherwise.
4.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following programs are examples of computer simulations? There are two correct answers.
A program that, given a date in mm/dd/yyyy format, uses Zeller's Congruence algorithm to return the day of the week for that date.
Microsoft Flight Simulator
A program that gives students the option of dissecting a virtual frog, rather than a real frog.
A program that charts COVID-19 hospitalizations based on data from all of the hospitals in a certain region.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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?
A program that calculates the billions of possible routes, and picks the most optimal route based on miles traveled and students served.
A heuristic approach that comes up with a reasonable set of routes that is not necessarily the most optimal solution.
Just let the bus drivers figure it out.
Develop a database of all possible routes, then use the SQL min function to find the set of routes that takes up the least number of miles.
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
True or False: there are certain problems that cannot be solved algorithmically.
True
False
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The number of moves required to solve the Towers of Hanoi problem depends on the number of discs used in the problem. The minimum number of moves is 2 raised to the nth power, where n = the number of discs, minus 1. In other words, the number of moves grows exponentially. When measuring the efficiency of an algorithm, is this growth rate considered reasonable or unreasonable?
Reasonable
Unreasonable
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
17 questions
"switch" Java Statement - 1
Quiz
•
9th - 10th Grade
15 questions
Grade 12-Python selection&iteration
Quiz
•
11th - 12th Grade
14 questions
Python Revision
Quiz
•
University
8 questions
Errors in Excel
Quiz
•
7th - 9th Grade
17 questions
Coding Titans
Quiz
•
University
14 questions
python functions
Quiz
•
University
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops
Quiz
•
9th Grade - University
13 questions
C programming-1
Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade