in my do while loop, i have the user enter a response with y or n to continue or end the program. during the loop, if i enter y or Y, it would skip asking the first number, line 24 and go to asking the second number, line 36. does anyone know why it skipping a step and go to the next step?
EDIT: code removed and problem solved so i did a new problem thats like my old one, where coder777 reply would solve it =D
Skipping that line happens when mixing 'getline()' and 'cin >> ...;' since 'cin >> ...;' leaves the new line in the stream which 'getline()' takes and returns immediately.
When it comes to cin you don't need 'getline()' since the console always waits for 'enter' to return.
I put the original post here, as it had been deleted, and I now remove it again at request of dznguy who does not want his homework assistance in full view of the world. :)
since this is a hw assignment which i wrote from scratch and if anyone who happen to stumble upon this code in the future would just copy it and does nothing else =x. so for their benefit, i just removed it