Can someone help walk me though ps1b i am still trying to understand while functions and what happens when they are nested together
please post your code with a paste site as pastebin.com, as it posts it correctly with the true indentations etc.:)
ok thanks, my questions though is does the program run one iteration of the first while function then go onto the second and run all interations until it is complete then go back and run another interation of the first while function and repeat the process of the second??
i guess a better way of wording this is that the computer won't go past line 35 until the conditions of the while statements are correct. i understand that but once the it gets to the second while statement won't the second while statement be ran 12 times before it returns to the first one on line 15 then it adds 10 to monthly payments and runs through all the loops again
ok 1st of all u dont need the 1st while since u iterate balance in the 2nd. so try to fix this and see how it goes. i am now testing for correct results. did they give any test cases? so we know we are getting the correct results?
well this is an exact copy of the code they provided as a solution i am just trying to walk through it and understand how it works
and yes enter balance at 1200 and .18 interest should yield a monthly payment of 120 and 11 months
ah well then lets see....
i think i understand how this works now so no need i think just putting my questions to paper really helped me understand how it worked
you always have to put questions and steps in paper...it helps a lot! it is some kind of pseudocode that you are creating when putting ur thoughts in paper. if you need any other help just ask. (if you need i have an other version of this with for loops).
Join our real-time social learning platform and learn together with your friends!