The following pseudocode works, but it performs a case-sensitive validation of the user’s input. How could the algorithm be improved so the user does not have to pay attention to capitalization when entering a name?
// This program asks the user to enter a string
// and validates the input.
Declare String choice
// Get the user's response.
Display "Cast your vote for Chess Team Captain."
Display "Would you like to nominate Lisa or Tim?"
Input choice
// Validate the input.
While choice != "Lisa" AND choice != "Tim"
Display "Please enter Lisa or Tim."
Input response
End While
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here