I have a small problem in my program. The program runs fine, but when the user is prompted to enter a second diver it skips the diver's name entry and goes right to the diver's city name entry. This is only my third week of C++ and what we have to deal with is little. We've learned if/else statements, nested if's, the 3 loops, some data manipulation- basically all you see here. One thing I did add instead of a 'continue' in my if's I used a few 'goto' lines, though we've not learned them yet. Not sure if my teacher will knock off points for it. Can anyone help or point me in the right direction on the user entry for the diver name problem?
Thanks for the link, but I went for a short fix so as not to rewrite a lot of the code. Next project I'll keep the information you passed on in mind. My fix was this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// declared another string
string pause = "";
// outside of main loop added a message to the user
cout << "Press 'ENTER' to begin";
// main loop setup
while (mainLoop == 'y')
// in the loop where data entry was to begin for user I added the command
// for the 'ENTER' message
getline (cin, pause);
cout << "\nEnter diver name: " << diverName;
Now the second time through it skips the ENTER for user and jumps instead to diver name entry.