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 :)
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.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Here is the problem set
it IS OK that you thought part of the problem was hard.
want to post your solution?
please use a code pasting site:
paste your code there and post the link here. select Python syntax highlighting when u paste.
here is the first part. i'll post the rest later today.
what do you think?
Not the answer you are looking for? Search for more explanations.
the result of floating point math is a float - you don't need to coerce so many variables to float.
does it work?
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?
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"
your code cleans up quite a bit when all the xtra 'float()'s are removed
here is the answer key:
let me know what you think
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
Because you know the time period is going to be 12 months, you can also use a 'for' syntax instead of a 'while', see: