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

Working on problem 1 . All is well except I am getting far too many decimals. i only need to decimals.

OpenStudy (anonymous):

Can you dpaste.com your program please? I'll take a look.

OpenStudy (anonymous):

attached

OpenStudy (anonymous):

@Sfaleman try using the round function to wrap your calculations. The second parameter to round is the number of decimal points you want. minimumMonthlyPayment = round(minimumPayment * currentBalance, 2)

OpenStudy (anonymous):

So line 11 in your code would change from: a=minrate*owe to: a=round(minrate*owe,2)

OpenStudy (anonymous):

perfect! R=Thanks!

OpenStudy (anonymous):

Anytime, Happy Coding :)

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!