APCS Principles Semester 1 Final Exam Review Part 1

APCS Principles Semester 1 Final Exam Review Part 1

Assessment

Flashcard

Computers

11th Grade

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

40 questions

Show all answers

1.

FLASHCARD QUESTION

Front

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.

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?