Hey I don't get how to do Problem 3 of pset 2. I don't know if it's necessary but here is my answer for problem 1 of pset 2. http://pastebin.com/N7gS2uvM and here is my code so far from problem 3 i keep getting no solution for all answers tho.
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!
Just before pset2 prob 3 there is an explanation of how to write the code for prob 3 - try to turn it into a function. The theory is that if you can find 6 successive numbers of nuggets that you CAN buy then you can buy all numbers above that number.
So just start at one, can you buy one? no, can you buy two? no ... keep increasing the number - every time you find a number you can't buy, save it. If the theory is true, eventually you will find six in a row that you CAN buy - you are done - the last number you saved (because you could NOT buy it) is the highest number of of nuggets you can't buy ...
there are probably other ways to do it
it helps to put print statements in your code to see what it is doing and see if it is doing what you want - print variables, print counters, print results of tests or calculations. you can always comment them out when they become obnoxious
Sorry I forgot to post the second link last night i have already started it i just keep getting no solution and i don't know why? http://pastebin.com/ypiRdb5k