
AP Computer Science Principals - Algorithm-Quiz 1
Authored by zina aldolymi
Computers
12th Grade
Used 18+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Silas develops this algorithm to compute the calories burned for an activity for a given number of minutes and body weight:
•If the activity is running, compute caloriesPerMin by dividing weight by 10.5
•If the activity is walking, compute caloriesPerMin by dividing weight by 15.5
•Compute numCalories by multiplying caloriesPerMin by numMinutes
He implements the algorithm in an app, and users soon ask for the ability to compute the total calories for multiple sessions of walking or running.
What structure must be added to the original algorithm so that it can compute the total across multiple sessions?
Sequencing
Iteration
Selection
None of the above
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The algorithm below determines whether a given year is a leap year.
•If year is not divisible by 4, set leap_year to false
•Else if year is not divisible by 100, set leap_year to true
•Else if year is not divisible by 400, set leap_year to false
•Else, set leap_year to true.
Which of these tables correctly shows the results of this algorithm on the given values of year?
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Ali develops an algorithm that counts the number of words used in an essay.
Now they've been asked to extend the algorithm to ignore common words (like "the" and "to").
What structure must be added to the algorithm so that it does not count common words?
Sequencing
Iteration
Selection
None of the above
4.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
The following algorithm computes the average height for a list of basketball player heights.
•Initialize a variable sum to 0.
•For each height in the list:
•Convert height from feet & inches format to total inches
•Add height to sum.
•Return sum divided by the total number of heights.
Which building blocks are involved in this algorithm?
Note that there may be multiple answers to this question.
Choose all answers that apply:
Sequencing
Iteration
Selection
None of the above
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Layla is developing software for an animal shelter. After some research, she comes up with this algorithm for calculating the number of daily calories required for a dog:
•Calculate the Resting Energy Requirement (RER) by raising the dog's weight to the 3/4 power and multiplying the result by 70
•If the dog is neutered, multiply RER by 1.6
•Otherwise, multiply RER by 1.8
After verifying the algorithm comes up with a reasonable number for a single dog, she decides to extend it to compute the total calories needed for all the dogs in the shelter each day.
What structure must be added to the original algorithm so that it can compute the calories for multiple dogs?
Choose 1 answer:
Sequencing
Iteration
Selection
None of the above
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
"Aba speak" is a game invented by school children to disguise what they're speaking.
When speaking, they transform each word following this algorithm:
Following that algorithm, how would they transform the word "avocado"?
Choose 1 answer:
avabocabadabo
abavbvobocbcabadbdobo
abavobocabadobo
abvobcabdob
abavobacabadoba
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
An online store uses an algorithm that calculates the total revenue from customer orders by summing up all the order amounts.
They discover that their algorithm is including refunded orders, which are recorded as negative amounts, and decide to refine the algorithm to ignore those.
What structure must be added to the original algorithm to ignore the refunded orders?
Choose 1 answer:
Sequencing
Iteration
Selection
None of the above
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
BÀI 8. SẮP XẾP VÀ LỌC DỮ LIỆU
Quiz
•
1st - 12th Grade
11 questions
Access
Quiz
•
10th Grade - University
10 questions
Blockchain
Quiz
•
1st Grade - University
11 questions
AP CSP Review 11Q
Quiz
•
10th - 12th Grade
10 questions
Review I-PM Ujikom Multimedia
Quiz
•
12th Grade
10 questions
Unit 4 Advanced AP CSP
Quiz
•
9th - 12th Grade
10 questions
Cybersecurity Quiz
Quiz
•
12th Grade
12 questions
Spreadsheet Starter
Quiz
•
7th Grade - University
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
21 questions
Presidents Day Trivia
Quiz
•
6th - 12th Grade
10 questions
Valentine's Day: History and Modern Celebration
Interactive video
•
9th - 12th Grade
11 questions
Valentine's Day Trivia
Quiz
•
8th - 12th Grade
10 questions
Factor Quadratic Expressions with Various Coefficients
Quiz
•
9th - 12th Grade
18 questions
Success Strategies
Quiz
•
9th - 12th Grade
10 questions
Valentine's Day Trivia
Quiz
•
9th - 12th Grade