i have this assignment due for school to write a simple program to calculate loans. it compiles and runs in dev c ++ but does not in cygwin, which my teacher uses to grade it. it does not loop over and over like its supposed to. it says id returned 1 exit status and has a warning... no newline at the end of file. what do i need to do to get this working like its supposed to? here is my code.
As for the warning take a look at line 97. That line has no purpose currently -- you're just taking loanCount, adding 1, then discarding the result (the sum isn't getting stored anywhere).
You probably meant to use the += operator.
As for why it's not working on Cygwin, I haven't the foggiest. It's compiling and running fine with GCC on my machine. I don't see anything that would cause compiling to fail or the program to exit abnormally.
What Disch said about line 97 is correct, but "no newline at the end of file" means it wants you to scroll down to the bottom and hit "enter" so the last thing in the code is an empty line.
Line 97 as you have it there doesn't do anything, it's just a value. It's like writing 5;
If you want to increase loanCount by 1, you need to say loanCount += 1; or loanCount = loanCount + 1;or loanCount++;