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

Hello. Can someone show me the script used on PS#1 - Problem 2 - "Paying Debt Off In a Year". I can do the problem 1 with no problem, but i'm having problems in writing a coherent script that can throw the minimum payment under 12 months. Thank you in advance.

OpenStudy (anonymous):

Hmm... PS1 is the prime number problem. Are you talking about PS4, the retirement fund problem?

OpenStudy (anonymous):

http://mit600.mit.edu/blog/problem-sets/problem-set-1/ I already saw that the new PS#1 refers to a prime number question, sorry for the missing. I leave the link to the problem set i'm refering. Thank you again.

OpenStudy (anonymous):

Oh, are you taking the actual MIT 6.0 class right now, at MIT?

OpenStudy (anonymous):

No Julie, but you can try to do both problem sets :) the OCW and the actual course, since they are public too :).

OpenStudy (anonymous):

so post what you have and we'll take a look at it

OpenStudy (anonymous):

use dpaste.com or pastebin.com or something similar to post your code

OpenStudy (anonymous):

hmmm, you need to write down the equation that you going to solve then write down in words how you might go about solving that with a program then try to turn the words into a program they give a couple of test cases and a hint that should get you started. it looks like the hint is pointing to an extension of the solution to problem one. make the problem one solution repeatedly calculate the ending balance with different monthly payments till you find a monthly payment that will result in a balance of zero after 12 months.

OpenStudy (carlsmith):

@bwCA Hi there, I haven't been on much for a while. You're a Superstar now bwCA? Well done mate.

OpenStudy (anonymous):

Hello again. @bwCA - 1º of all, ty for the answer. Well i know there are alot of ways to deal with the problem presented but although problem 1 and 2 seems similar in the way of solving, they are a bit diferent in the way of solving (at least for the solution i came up). Thats why i asked for the iteration script that would allow me to repeat it (or better i asked for all the script to try to understand all the steps), since the equation presented that is intended to solved is already showed. (balance=balance*(1+rate)-minimumpay). The question that i was having difficulty, it was to after only 12 months increment the minimum pay and not before that and to repeat the procedure until the balance was 0 or less. ---"""--- I think there is no wrong on showing solutions, since i know everyone tries their best of solving problems before asking, so i will show the solution i came with (there may be better ways :P) http://pastebin.com/UqFueVdS

OpenStudy (anonymous):

here is mine, gets the same answer as yours.. http://pastebin.com/zfyW8CXY

OpenStudy (anonymous):

...and here's one from me too. http://codepad.org/xntZvW69

OpenStudy (anonymous):

@bwCA and walkerp1: Ty for the scripts :).Its always good to have different perspectives to solve the same problem :).

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!