Hello, I was wondering if all i need to add was another do loop outside of the current do loop for the program to keep asking H, L, or E when an invalid character was entered?
You can make another loop (I would actually put it inside the current loop rather than outside if you do that) or you can just keep it the way it is. Running Alex's revised code, it already asks again when it gets bad input. If you want to add an error message to display when the user enters bad data, add an "else" statement after the if-else statements that displays the error message, but doesn't change the correct or wrong variables.
Reputation Points: 2614
Solved Threads: 687
Posting Expert
Offline 5,372 posts
since Jan 2008