2020 Practice Exam 1 MCQ.png

2020 Question 4.png Reason C is correct: Overflow errors occur when an arithmetic operation results in a value outside the range of numbers that can be represented by a fixed number of bits. 2020 Question 15.png Reason A is correct: Program A initializes i to 1. Inside the loop, it prints i and then increments i. The loop terminates when i is greater than 10, which occurs after 10 is printed. Program A prints 1 2 3 4 5 6 7 8 9 10. Program B initializes i to 0. Inside the loop, it increments i and then prints i. The loop terminates when i equals 10, which occurs after 10 is printed. Program B prints 1 2 3 4 5 6 7 8 9 10. 2020 Question 18.png Reason B is correct: This code segment moves the robot forward whenever there is an open square in front of it. Once there is not an open square in front of it, the robot rotates right. The robot moves forward from its initial location to the upper right corner of the grid, then rotates right, then moves forward to the bottom right corner of the grid, then rotates right, then moves forward to the bottom left corner of the grid, then rotates right, then moves forward two squares to the gray square. 2020 Question 22.png Reason D is correct: For this spinner, there is a 1/8 chance of “Lose a turn”, a 1/8 chance of “Move 2 spaces”, and a 6/8 chance of “Move 1 space”. The variable spin is set to a random value between 1 and 8. If spin is 1 (which occurs 1/8 of the time), the code segment prints “Lose a turn”. If spin is 2 (which occurs 1/8 of the time), the code segment prints “Move 2 spaces”. The remaining 6/8 of the time, the code segment prints “Move 1 space”. 2020 Question 33.png Reason A is correct: Without knowing the individual assignment scores, the administrator is unable to determine any of the student’s individual scores other than the lowest score. 2020 Question 34.png Reason C is correct: In this code segment, the first call to BotMover moves the robot forward one square, rotates it right one time so that it faces right, and moves it forward one square. The second call to BotMover moves the robot forward one square, rotates it right 3 times so that it faces toward the top of the grid, then moves it forward one square. The third call to BotMover moves the robot forward one square, does not rotate it, then moves it forward to the gray square. 2020 Question 38.png Reason B is correct: IPv6 allows for a greater number of IP addresses than IPv4 does, which allows more devices to be connected. 2020 Question 52.png Reason A is correct: Statement I is true. The REPEAT UNTIL loop terminates when hours is at least 24 or currentPop is at most 0. Statements II and III are false. The simulation displays the change in population over the entire course of the simulation. 2020 Question 53.png Reason C is correct: This system uses an application to enlist the services of a large number of people to help find a lost pet. 2020 Question 59.png Reason C is correct: Open-source software has source code that is released under a license that allows users the rights to use and distribute it. However, there is no guarantee that the original developer of open-source software will provide support for its users. 2020 Question 64.png Reason B is correct: Since y is initially negative, the loop condition count ≥ y is initially true, so the body of the loop is never executed and 0 is returned. Reason D is correct: Since y is initially negative, the loop condition count ≥ y is initially true, so the body of the loop is never executed and 0 is returned.