A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
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
anonymous
 5 years ago
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

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0i tested it with 18 as my number and it worked so I don't know why 15 won't work

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I 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
 5 years ago
Best ResponseYou've already chosen the best response.0How could you get this to print the best possible solution?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0This was for problem 1 i haven't figured out problem 3 yet.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0your 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
 5 years ago
Best ResponseYou've already chosen the best response.0Why do you need all possible? You only need one to know whether or not its a possible combination.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0If you want a script that prints all possible i have one but I don't see why you would need it.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0it helped me understand the logic for part 3 a little easier thats all

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0when 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
 5 years ago
Best ResponseYou've already chosen the best response.0I 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
 5 years ago
Best ResponseYou've already chosen the best response.0trying to make it more efficient

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0O 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
 5 years ago
Best ResponseYou've already chosen the best response.0Ok 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
 5 years ago
Best ResponseYou've already chosen the best response.0Probably not the best logic but it makes sense in my head haha.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Probably not the best logic but it makes sense in my head haha.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Hey 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.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.