Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question 9 of 10 the programmer wants to change this code so that a thi…

Question

question 9 of 10
the programmer wants to change this code so that a third background image
appears when the player presses the b button. what does the programmer
need to do?
forever
if is a button pressed then
set background image to
else
set background image to

a. change the conditional from a to b
b. add a while loop to the forever loop.
c. add another conditional to the control structure
d. change the forever loop to a while loop

Explanation:

Brief Explanations

To have a third background image when the 'B' button is pressed, we need to handle the 'B' button press condition. The current code has an if-else for the 'A' button. To add a new condition (for 'B' button) to control a third background, we need to add another conditional (like an else if or nested if) to the control structure. Option A would just change the existing 'A' button behavior, not add a third. Option B adding a while loop isn't relevant for handling a button press to change background. Option D changing the forever loop to while also doesn't help add the third background logic. So the correct approach is to add another conditional.

Answer:

C. Add another conditional to the control structure