Practice

Theatre Seat Booking Validation

2023/Oct/Nov·Variant 3
EASYLoops

Accept only whole numbers between 1 and 6 inclusive for the number of seats. Repeatedly ask until valid, then output the valid number.

Input: A sequence of integers. Output: The first valid integer entered.

Example:

Input:  0
        7
        4
Output: 4
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Two invalid then valid
Inputs: 0, 7, 4
Expected: 4
Test 2: Valid on first try
Inputs: 5
Expected: 5
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade