Hello, I am working on a project which I would like to loop back to the beginning of the program upon bad cin. The code is not complete but around line 30 is where I would like to have the program loop back to the beginning. The program output will look roughly like this when it loops (cin in bold):
Would you like a car wash today? yes
Which wash would you like: Super, Premium, or Ultra? super
That will be $5.00, is that okay? no way!
I'm sorry...
Would you like a car wash today? YES!!!
Which wash would you like: Super, Premium, or Ultra? Ultra
and you can place this wherever necessary to avoid having to return to the beginning every time an error is made
or you can also put lines 22 - 30 in a do while loop with the same argument, play around with it
by the way, there really isn't a need for choice2, since you're only using it to store a character response, just like what choice1 does, and since it's not necessary for choice1 to retain it's 'y' or 'n' response anyway.
I have changed the code to the following but it still doesn't loop back when the conditions aren't met in the while loop at the bottom. Any ideas? Thanks!