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

Code to the McNuggets question? I understand the algorithm, but I can't figure out how to code it. Anyone happen to have their answer handy?

OpenStudy (anonymous):

Considering programs solve problems in millions of different possible ways, it's not likely going to be very beneficial for you to just view how someone else does it. Programming is only 5% syntax and language, the other 95% is all problem solving skills. So your best bet when tackling a problem is to just dive in head first, a little bit at a time, and if you get stuck somewhere or you don't understand why something is happening, just ask for help (like here). I would have started you off with a template of sorts to get you going, but you didn't specify which part of Problem set 2 you're on right now.

OpenStudy (anonymous):

I'm pretty sure this is PS2 problem 3. The problem is really two problems. The first problem is determining if a certain number of McNuggets can be bought. The second problem is figuring out the highest number that can't be bought. The solution to the second problem depends on the solution to the first problem. So focus on only solving the first problem. Only once you get that working correctly and reliably, and you understand exactly how it works, should you try to do the second part. In the pdf they have some pseudocode. Look at the sentence that starts "Test if there exists non-negative integers a, b, and c..." That's the part you should get working first.

OpenStudy (anonymous):

If you're just looking for answers, you can see this guy's site. I understand he posted his solutions for all the problems in this class: http://proficiamus.blogspot.com/ Also, if you dig deep enough in this forum, you will find tons of codes for all the problem sets.

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!