knowing whether the input is wrong
Your code has lots of if statements. Add some more to test if the input is wrong.
You could make a loop to get the user input, test if the input is valid and exit the loop if it is. If the input is bad, tell the user and loop back to ask the user again for some input:
begin loop
ask user for input
get input
test input
if input is good exit this loop
tell user input is bad
end loop // here the execution would go back to the begin loop point
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656