Hello, I am totally new to C++. I'm looking to repeat this program with a simple y/n. But I also want it set up to only accept y or n as proper inputs. Right now, anything other than 'y' will bring up the "invalid entry" text, but the program loops all the same. I can get rid of "processMenu" altogether and just use a do/while loop, which was working fine, but again, anything other than 'y' would exit the program, and I want to make y and n the only two possible answers. Can anyone help? I know this code I'm posting here doesn't work, in fact, it might not even be compiling at the moment, so I apologize, it's about 5 in the morning here and I'm due some sleep. Thanks in advance for any help.
Well that's what I'm asking. How would I get the program to only respond to y or n? With the code as above, it loops as it should when I press y, when I press any other key it moves to the error displays, but yet it just continues looping the program anyway instead of repeating the option to press y or n. I guess I might be explaining it badly, too. Like I said, early in the morning here, and little sleep.
Hmmm, when I changed it as you suggested, n just simply acts like y and loops the program back around. Any other input closes the program still. Like I could input q, and the program will close. And the error messages don't pop up at all now, like "sorry, not a valid choice", isn't displaying no matter what I try.
Basically what I want the program to do is perform the math, ask if I want to do it again, if I hit y, it starts again, if I hit n, it exits. If I hit anything other than y or n, it tells me that's an invalid input and to try it again.
Thanks for the help, man, I finally got it. It's not exactly what you typed out for me, but it gave me the starting point that led to the fix. Everything loops and exits perfectly now. Again, thanks so much.