anonymous
  • anonymous
I went through the first problem set (the one that had us write programs to pay off credit card debt). I didn't struggle with the actual programming, but I thought that the hardest part was trying to figure out what the formula would be for the different payments. Is that ok?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
Here is the problem set http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-1/lecture-4-machine-interpretation-of-a-program/MIT6_00SCS11_ps1.pdf
anonymous
  • anonymous
it IS OK that you thought part of the problem was hard. want to post your solution? please use a code pasting site: - http://dpaste.com - http://pastebin.com - http://www.repl.it/ - http://pastie.org - http://codepad.org - http://ideone.com paste your code there and post the link here. select Python syntax highlighting when u paste.
anonymous
  • anonymous
here is the first part. i'll post the rest later today. http://dpaste.com/hold/1225193/ what do you think?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
the result of floating point math is a float - you don't need to coerce so many variables to float. does it work?
anonymous
  • anonymous
It mostly works. The only inconsistency is that my program is with how my program round the final decimal. For example, the total amount paid for the first example in the answer key is $1131.12, but my program returns it as $1131.11. How serious is this as a programming error?
anonymous
  • anonymous
why do you think it is an 'error' what were the parameters - balance, interest rate, payment rate? I can't seem to find the 'answer key' The main idea of the problem set is described as : "This problem set will introduce you to using control flow in Python and formulating a computational solution to a problem"
anonymous
  • anonymous
your code cleans up quite a bit when all the xtra 'float()'s are removed http://dpaste.com/1227748/
anonymous
  • anonymous
here is the answer key: http://dpaste.com/1227768/ let me know what you think
anonymous
  • anonymous
that solution rounds during calculations - which i think is (technically) incorrect. I think the correct solution would only round during printing - like you did. so the difference is a rounding error but the main topic of the pset is flow control and formulating computational solutions
anonymous
  • anonymous
Because you know the time period is going to be 12 months, you can also use a 'for' syntax instead of a 'while', see: http://dpaste.com/1232335/

Looking for something else?

Not the answer you are looking for? Search for more explanations.