I'm not sure how to use the for command in this instance. The pseudo code says "for count = 1-12", but I'm not sure how to translate that into syntax. I would ask my professor, but it's way too late to call. Please help, I don't even care if you mock me and call me names. I CAN TAKE IT.
The normal idiom for doing something a set number of times is:
for (int a = 0; a < 12; ++a) {}
But magic numbers are not a good idea, so use a const variable instead:
1 2 3 4 5
constint MaxNumPayments = 12;
for (int a = 0; a < MaxNumPayments; ++a){
// do whatever
}
Reason for starting at zero is because arrays start at zero, getting used to doing it this way won't cause you any errors when you come to using arrays. Subscripting for other things start at zero also.
Whenever I see this: for (int i =1; i <=12; i++), I am immediately suspicious.
@LivinLikeLarry
Your logic isn't quite right with your use of the payment variable in your loop.
Also, were you meant to use int for the money values? double would be be better.