Full disclosure: this is a homework project, so please do not give me complete answers on how to fix something, however please tell me whats wrong and hint at a fix please. Thank you all in advance for giving this a once over, I really appreciate it.
I am having major issues with vectors and getting the data to be displayed correctly. The top row of the table is supposed to be the monthly rate (starting at 3% increasing by 0.5% to 5.5%), and the row headings the years (starting at 15 ending at 30, increasing by 5year increments). However my program just displays the loan amount and nothing else. Any hints/help you could give would be greatly appreciated, because at the moment I am completely stuck.
You might be going round the loops 4 and 6 times respectively, but those aren't the indices you're writing to.
You're trashing memory way outside your array.
> for (int iCol = 3; iCol < 6; iCol += 0.5)
Adding .5 to an int is likely to leave it unmoved.
3 + 0.5 is still 3 (as an integer)
> grid[iRow][iCol] = monthlyPayment;
You probably want some variable result, say monthlyPayment = loanAmount * monthlyRate / (1 - 1 / pow((1 + monthlyRate), months));