Practice
Temperature Range Sentinel
EASYSelection
Monitor temperature readings (real numbers) and output a warning for each:
- Strictly below 35.0 →
"Temperature too low" - Strictly above 38.0 →
"Temperature too high" - Otherwise →
"Temperature normal"
Continue until the rogue value 999.0 is entered (do not evaluate 999.0).
Input: A sequence of REAL numbers ending with 999.0. Output: A string evaluation for each valid temperature.
Example:
Input: 34.2
36.1
38.5
999.0
Output: Temperature too low
Temperature normal
Temperature too high
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: One of each category
Inputs: 34.2, 36.1, 38.5, 999.0
Expected: Temperature too low
Temperature normal
Temperature too high
Test 2: Immediate sentinel, no output
Inputs: 999.0
Expected:
Ctrl+Enter
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade