Which of the following changes can be made so that the code segment works as intended?
Understand the Problem
The question is asking how to modify a code segment to ensure it correctly assigns a value to 'score' based on given conditions involving 'penalty'. The key concepts include understanding conditional statements and the impact of mathematical operations on the values involved.
Answer
Change line 1 to IF(score - penalty < 0).
The correct change is to change line 1 to IF(score - penalty < 0) to ensure score is not negative after subtraction.
Answer for screen readers
The correct change is to change line 1 to IF(score - penalty < 0) to ensure score is not negative after subtraction.
More Information
The current condition checks for a negative result after penalty deduction, which directly aligns with the requirement. No changes are necessary to line 1.
Tips
Common mistake is misinterpreting the condition needed to prevent a negative score.
AI-generated content may contain errors. Please verify critical information