QUESTION IMAGE
Question
2 multiple choice 1 point \you win!\ never displays. what change would fix this issue? 1 2 3 4 5 6 7 line 3 - remove var line 4 - change conditional to score >= 5 line 5 - change to a get text command line 1 - change variable name to total score
Step1: Analyze variable scope
In line 3, using var score creates a new local variable instead of updating the global score variable. Removing var will update the correct score variable.
Step2: Check conditional logic
If we remove var in line 3, when score reaches 5 (e.g., after 5 clicks: initial 0, then 1 - 5 clicks make it 5), with the original condition score > 5 (line 4), it won't trigger. But if we just focus on the var issue (as per the options, the first option is about the var), removing var in line 3 is the fix. Let's assume the code is supposed to update the global score. When var is used in line 3, it's a new local variable. So removing var makes the code update the correct (global) score variable. Then, when score gets to 6 (for example, if the intended logic is cumulative), the condition score>5 works. But if we consider the options, the first option (Line 3 - remove var) is the fix for the variable - scoping issue which is the root cause of the wrong score value being checked.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
Line 3 - remove var