Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Problem with knapsack program (Java)

I have a project due to today at midnight and I am trying to get what I was asked for it. However, I am unable to do that. The problem is that I have to make the output like this: http://puu.sh/dpDLv/d93cd8b91b.txt

This is in the book: http://puu.sh/dpaXU/d7885f8e24.png (Data Structure in Java)

The project is http://puu.sh/dpbmg/7f505f298e.png

My code: http://puu.sh/dpDuc/c911298f22.zip

2 Answers

here is a SO post that explains what you need to do to solve the knapsack problem and provides some implementation. Since it is a homework problem he does not provide a full solution. Which is probably for the best.

With that post and some more googling you should be able to figure this out.

Mr. Preston,

What he wants is that my code have to display the following; http://puu.sh/dpE1F/d6a9d46237.png which is what I am trying to figure it out. I will read the above link to find further information about this topic.

Thank you for responding.