If you want lines 45-48 to run only in association with the last else if, then they should be enclosed in a code block using curly brackets. Probably a better thing, however, would be to output statement to user that the selection entered is invalid and they should try again. Lines 27 through 49 could then be run inside an inner loop as many times as needed until valid input is entered. Valid input could include a third choice, number 3, that will voluntarily exit the program the input loop.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005