- 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
A travel planning site reviews the layovers on an itinerary. If a layover is greater than 24 hours, the site should suggest accommodations. If the layover is less than one hour, the site should alert for a possible missed connection. What potential issue could arise if two separate if statements are used instead of a chained if-elif structure when processing a layover of exactly 1 hour?
Choose the correct answer below:
-
A
The program may fail to execute either branch, causing no action to be taken.
-
B
The program may raise an error due to logical inconsistency.
-
C
The program may only suggest accommodations and ignore the missed connection alert.
-
D
The program may execute both branches, causing conflicting actions to be taken.