anonymous
  • anonymous
Hey I'm on Pset2 I kind of have it figured out but mine code only works for big numbers. When i use 15 as my number of nuggets i get no solution but when i use 56 or 58 i get correct answers. Here is my code please help as much as you can. http://pastebin.com/tiNdLAiM
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 :)
SOLVED
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.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
i tested it with 18 as my number and it worked so I don't know why 15 won't work
anonymous
  • anonymous
I figured it out here is my completed version. http://pastebin.com/N7gS2uvM I added lines 6 and 8. If you have questions on what i did feel free to ask.
anonymous
  • anonymous
How could you get this to print the best possible solution?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
This was for problem 1 i haven't figured out problem 3 yet.
anonymous
  • anonymous
your program for the first problem only prints the worst solution. I reworked it so that it prints all possible solutions. Now i just need to get the best one. I'm having trouble figuring out what kind of statement will help me accomplish that
anonymous
  • anonymous
Why do you need all possible? You only need one to know whether or not its a possible combination.
anonymous
  • anonymous
If you want a script that prints all possible i have one but I don't see why you would need it.
anonymous
  • anonymous
it helped me understand the logic for part 3 a little easier thats all
anonymous
  • anonymous
yes i have both also
anonymous
  • anonymous
O ok
anonymous
  • anonymous
when it prints all the solutions the last one is always the best. I just need to find a way to only print that one
anonymous
  • anonymous
I don't know how to only print last one but what I'm wondering is why you only want last one. I don't see what it changes last or first as long as there is a solution.
anonymous
  • anonymous
trying to make it more efficient
anonymous
  • anonymous
O I see what your doing your thinking if it was an actual mcdonalds what would be the best way to arrange it. am i correct?
anonymous
  • anonymous
exactly
anonymous
  • anonymous
Ok cool I probably should be doing that too but right now I'm more focused on learning the syntax of the language and later on when I know more about the language I will be able to apply it in any way I want.
anonymous
  • anonymous
Probably not the best logic but it makes sense in my head haha.
anonymous
  • anonymous
Probably not the best logic but it makes sense in my head haha.
anonymous
  • anonymous
Hey I was laying down going to sleep and was thinking what if you change the order of the solutions like you said my worst solution comes first. Well in my code i solve for large first. What if you solve for the small first then medium and then large then your solutions will be in opposite order. At least that makes sense to me. I don't know whether or not it will work and I'm going to bed so I don't have time to test it but if you really want the best possible solution it's worth a try. Let me know if this works or if it helped you find the solution basically just keep me updated.
anonymous
  • anonymous
thats all it needed.
anonymous
  • anonymous
Sweet!

Looking for something else?

Not the answer you are looking for? Search for more explanations.