Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started