Practice
Validated Score Entry
MEDIUMLoops
Write a program that repeatedly asks the user to enter a score until a valid score is entered. A valid score is an integer in the range 0 to 100 inclusive. Once a valid score is entered, output it.
Use a REPEAT UNTIL loop for validation.
Input: One or more integers (loop repeats until a value in 0โ100 is entered). Output: The first valid score entered.
Example:
Input: 150
-5
75
Output: 75
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: Valid on first attempt
Inputs: 75
Expected: 75
Test 2: Invalid then valid
Inputs: 150, 50
Expected: 50
Test 3: Edge: 0 is valid
Inputs: -5, 0
Expected: 0
Ctrl+Enter
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade