- Structured Programming
- Selection Control Structures
- Code Blocks
- Condition Examples: Temperature Conversion Pseudocode
- Condition Examples: Python Code
- Structured Quiz 5 questions
- If and If-else Statement
- If and If-else Quiz 5 questions
- Chained Decisions
- Chained Decisions Quiz 5 questions
- Nested Decision
- Nested Decision Quiz 5 questions
- Conditional Expressions
- Conditional Expressions Quiz 5 questions
Quiz Question 1 of 5
Given the following code snippet:
score = int(input())
if score < 70:
score += 10
if 70 <= score < 85:
score += 5
A student runs this code with an initial score of 65. What is the final value of score
, and how does the program's logic flaw impact the final result?
Choose the correct answer below:
-
A
65; Neither if statement should execute due to flawed logic.
-
B
80; The program correctly executes both if statements due to valid conditions.
-
C
70; The first if statement executes, but the second if statement does not.
-
D
75; The second if statement incorrectly executes after the first, altering the intended flow.