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

can anyone give me any hints on pset1 problem number 2 ?(ocw scholar version)

OpenStudy (anonymous):

First, you need to assign the variables for the problem, which are balance and the annual rate, which i assigned to the variables, 'bal' and 'ann_rate' respectively. Afterwards, find the monthly rate, (mon_rate). Define a minimum payment variable (min_pay). The real clockwork of the program comes in the form of a control statement - i used a for statement embedded in a while statement. I reasoned, WHILE balance remains above zero, continue subtracting however amount of min_pay FOR 12 months; if bal still remains over zero, increase the value of min_pay. Afterwards, print the result using print("xxxxxxxxxx" + str(round(x,2))) - x's representing text or variables necessary. Hope this helped!

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!