Question: 3.1 (Validating User Input) Modify the script of Fig3.3. to validate its inputs. For any input, if the value entered is other than 1 or
3.1 (Validating User Input) Modify the script of Fig3.3. to validate its inputs. For any input, if the value entered is other than 1 or 2, keep looping until the user enters a correct value. Use one counter to keep track of the number of passes, then calculate the number of failures after all the users inputs have been received. Hint: Use a While loop to test if the value entered is not equal to 1 and not equal to 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
