Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 15 Online
OpenStudy (anonymous):

I'm working on the second problem in problem set 1. I understand what to do... but I'm confused. I can get it to calculate the correct monthly payment, but how do I find how many months it takes to pay off (and the balance afterward)?

OpenStudy (anonymous):

use a loop, each iteration of the loop represents a month, each month you add the interest then subtract the payment

OpenStudy (anonymous):

Thank you so much! For anyone having the same problem: I used two loops. The first loop was to find the minimum monthly payment by testing all 12 months and then adding to the payment if it wasn't enough. Once I found the payment, I went on to the second loop, which is the one bwCA described.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!