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

Hi all - i'm still struggling with problem 1 in pset2 (i know: the deadline is over :(( ). http://codepad.org/AziXlzDL I have two questions: - I suck at economics, and i'm not sure I understand the "minimum payment rate" formula correctly - I get a syntax error in line 8...why? Thanks for your help

OpenStudy (anonymous):

You are missing a bracket in the previous line to close for the "float" call!

OpenStudy (anonymous):

thanks - now at least I can run it - but my numbers are completely wrong

OpenStudy (anonymous):

For one you don't need to increment the month. The for loop does it automatically!

OpenStudy (turingtest):

If "minimum" is your minimum monthly payment then minimum=balance*minMonthlyPayRate ...and these two lines are wrong minimum = float(abs((balance * monthlyPaymentRate)- balance) balance = abs(minimum - balance) Think carefully about *what* values you are updating each month. Also what @Chris2332 said

OpenStudy (anonymous):

You've introduced many lines you don't need, and aren't taking into account the given formulas: Monthly interest rate= (Annual interest rate) / 12 Minimum monthly payment = (Minimum monthly payment rate) x (Previous balance) Updated balance each month = (Previous balance - Minimum monthly payment) x (1 + Monthly interest rate) Also keep track of your Total Paid (this not increment by 1 each time) Introduce the formulas inside your loop and print the requested data like you was doing. An advice: round the number at the end, when you print them, to keep your calculations accurate.

OpenStudy (anonymous):

thank you all ! I did some reading offline yesterday and it makes a lot more sense now

OpenStudy (anonymous):

So did you get everything ok? Do you need anything to be explained more?

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!
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!