A certain game keeps track of the maximum and minimum scores obtained so far. If num represents the most recent score obtained, which algorithm correctly updates the values of the maximum and the minimum? Options: If num is greater than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num. If num is less than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num. If num is less than the minimum, set the minimum equal to num. Otherwise, if num is less than the maximum, set the maximum equal to num. If num is greater than the minimum, set the minimum equal to num. Otherwise, if num is less than the maximum, set the maximum equal to num.
APCS Principles Semester 1 Final Exam Review Part 1

Flashcard
•
Computers
•
11th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

40 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
If num is less than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num.
2.
FLASHCARD QUESTION
Front
Which algorithm allows the robot to make a single circuit around the rectangular region of black squares, finishing in the exact location and direction that it started in each of the four grids? Step 1: Keep moving forward, one square at a time, until the square to the right of the robot is no longer black. Step 2: Turn right and move one square forward. Step 3: Repeat steps 1 and 2 three more times.
Back
Step 1: Keep moving forward, one square at a time, until the square to the right of the robot is no longer black. Step 2: Turn right and move one square forward. Step 3: Repeat steps 1 and 2 three more times.
3.
FLASHCARD QUESTION
Front
Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, they should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?
Back
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.
4.
FLASHCARD QUESTION
Front
A teacher has a goal of displaying the names of 2 students selected at random from a group of 30 students in a classroom. Any possible pair of students should be equally likely to be selected. Which of the following algorithms can be used to accomplish the teacher’s goal? Options: Step 1: Assign each student a unique integer from 1 to 30. Step 2: Generate a random integer n from 1 to 30. Step 3: Select the student who is currently assigned integer n and display the student’s name. Step 4: The student who was selected in the previous step is assigned 0. All other students are reassigned a unique integer from 1 to 29. Step 5: Generate a new random integer n from 1 to 29. Step 6: Select the student who is currently assigned integer n and display the student’s name.
Back
Step 1: Assign each student a unique integer from 1 to 30.
Step 2: Generate a random integer n from 1 to 30.
Step 3: Select the student who is currently assigned integer n and display the student’s name.
Step 4: The student who was selected in the previous step is assigned 0. All other students are reassigned a unique integer from 1 to 29.
Step 5: Generate a new random integer n from 1 to 29.
Step 6: Select the student who is currently assigned integer n and display the student’s name.
5.
FLASHCARD QUESTION
Front
What is displayed as a result of executing the algorithm in the flowchart?
Back
5
6.
FLASHCARD QUESTION
Front
Which of the following initial values of j and k will cause the algorithm represented in the flowchart to result in an infinite loop? Options: j = -5, k = 5; j = 0, k = 5; j = 5, k = 0; j = 5, k = -5
Back
j = 5, k = -5
7.
FLASHCARD QUESTION
Front
Based on the algorithm represented in the flowchart, what value is displayed if j has the initial value 3 and k has the initial value 4?
Back
12
Create a free account and access millions of resources
Similar Resources on Quizizz
34 questions
AP Computer Science Principles Review

Flashcard
•
9th - 12th Grade
36 questions
AP CSP Unit 6

Flashcard
•
11th Grade
38 questions
AP Computer Science Principles Practice

Flashcard
•
10th Grade
38 questions
AP Computer Science Principles Practice

Flashcard
•
10th Grade
38 questions
AP Computer Science Principles Practice

Flashcard
•
10th Grade
36 questions
python functions

Flashcard
•
12th Grade
30 questions
AP CSA Unit 2 Review

Flashcard
•
10th - 12th Grade
33 questions
APCSP Unit 3 Vocabulary

Flashcard
•
10th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

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

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

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

Quiz
•
KG - University