// can't figure out condition. the above should continue to loop until 4
// is inputed when 4 is inputed below message should display
just display line 76 for case 4:
remember that break; will only cause your switch loop to exit, the outer while() loop will still run, and if option != 4; you'd get a nasty infinite loop
I think you are quite close, but matsom is correct - any value but option = 4 would result in the while loop never exiting. This is because nothing within the loop changes the value of option.
Simply move the code you are using to prompt the user for option (lines 35-40) inside the while loop but before the switch statement (ie between lines 42 and 43). This will allow the user to enter an option repeatedly until he/she enters 4.
You will need to initialize option to some value other than 4 so that the while loop is entered. You can do this where you declare option on line 7.
Also, you need a return 0; before exiting main().
@matsom. Good point regarding relocating line 76. That would work.
It will also work where it is now.
Thank you so much! I used both your advice because I couldn't get one to work without the other. I have another question...when I initialize option to value why doesn't it matter whether I use 1 or 0 or any number except 4?