Question: Goal: Use a while loop to perform an input validation Assignment: Imagine you are creating a puzzle game. One of the puzzles requires the player
Goal: Use a while loop to perform an input validation
Assignment: Imagine you are creating a puzzle game. One of the puzzles requires the player to find the combination to open a lock.
Write some code that reads the user input from the keyboard, and checks that the number they provided is the same as secretCode an it
variable that has already been declared and assigned a value. Keep asking the user to input a value until they match the secretCode
For example, if the secret code was : user input within square brackets
Wrong code
Wrong code
Wrong code
Correct!
Note: Write the lines of code necessary to capture and validate only the user input. You do not need to write a complete program. In c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
