need help with simple knapsack problem

Hey guys, ive been working on this program for a week and a half now for my independent study cs class, for anyone who doesnt know what the knapsack problem is heres how it goes: in a knapsack you have different weights, but with those weights you can arrange them in difffernt combinations to achieve a "goal" weight, if anyone can help me out with this id appreciate it heres what i have so far :