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

could someone explain these numbers? shouldn't it be salary * .05(because the .05 is an automatic) + salary * saved(whatever you want to save + salary * saved(matched by the company) i dont get these numbers: End of year 1 F[0] = salary * save * 0.01 End of year 2 F[1] = F[0] * (1 + 0.01 * growthRate) + salary * save * 0.01 End of year 3 F[2] = F[1] * (1 + 0.01 * growthRate) + salary * save * 0.01

OpenStudy (anonymous):

problem set 4 btw

OpenStudy (anonymous):

i assumed that 'saved' was the total amount, yours and the companies contribution - it makes it easier if you do that

OpenStudy (anonymous):

thanks i have it working but its not in a function and when i put it in a function it says that my list in undefined? but it works when its not in a function do you know whats up with that? salary = int(raw_input("Enter your salary: ")) save = int(raw_input("Enter the amount saved per year: ")) years = int(raw_input("How many years will you work: ")) growthRate = int(raw_input("What is the expected growthRate: ")) EofY = [] year1 = salary * save * .01 EofY.append(year1) for i in range(1,years): i = EofY[i-1] * (1 + .01 * growthRate) + year1 EofY.append(i)

OpenStudy (anonymous):

It seems to be working in a function???: http://dpaste.com/553787/

OpenStudy (anonymous):

yeah my bad, i just thought about it after posting that, i was missing a return statement when i put it in a function, thanks

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!