Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question 7 of 10 what happens at the end of each iteration of the repea…

Question

question 7 of 10
what happens at the end of each iteration of the repeat loop in this code?
function playlevel
splash \level\ convert level to text
repeat 2 times
do
set shark to sprite of kind enemy
set shark position to x 0 y 0
set shark follow fish with speed 20
pause 2000 ms

a. the number of sharks increases.
b. the program pauses for 2 seconds.
c. the sharks position on the screen changes.
d. the shark follows the fish at a speed of 2000.

Explanation:

Brief Explanations
  • Analyze Option A: The "set shark to sprite..." reassigns shark each iteration, not increasing shark count. So A is wrong.
  • Analyze Option B: The "pause 2000 ms" (2000 milliseconds = 2 seconds) is at the end of the loop's do - block. So at the end of each iteration, the program pauses for 2 seconds. This matches.
  • Analyze Option C: The shark's position is set to (0,0) at the start of the loop's do - block, not at the end. So C is wrong.
  • Analyze Option D: The speed for following is 20, not 2000. And the follow action is in the do - block, not specifically at the end of the iteration. So D is wrong.

Answer:

B. The program pauses for 2 seconds.