Hi ... I'm new to programming and I'm having some problems with PS2 problem 3. Could someone have a look at my code and give me some pointers? Here is my code: http://codepad.org/C1BVgWkE
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!
your while loop at line 3 will run as long as m is less than 50 but you never change m so it will run forever.
will 3 breaks (lines 12, 13, 14) work like that - for some reason i don't think it is doing what you want
Thanks for the advice. I have changed it so that m increases. I think it is better now. Could you tell me what you think? http://codepad.org/YxnsSebt
Line 24 of your output saya that 46 cannot be bought but two-twenties and a six would be 46 so your logic is wrong somewhere or maybe the limits in your range functions are wrong
sometimes it helps to put print statements in to see what is happening