The code looks a bit damaged in its copy-and-paste journey. However I suspect the lines:
//start while loop
while (termMonths >0);
The semicolon is an empty statement, so it says “If termMonths is zero or less, stop here forever”, which is probably not what you want. I would expect you want to swap the ; for a {, you program probably still won’t work but you’ll be a step nearer.
The code looks a bit damaged in its copy-and-paste journey. However I suspect the lines:
//start while loop
while (termMonths >0);
The semicolon is an empty statement, so it says “If termMonths is zero or less, stop here forever”, which is probably not what you want. I would expect you want to swap the ; for a {, you program probably still won’t work but you’ll be a step nearer.
Changing:
//decrement months
termMonths =144;
to something like:
//decrement months
termMonths–;
might also be helpful!