Question: Problem to solve: - Fill a single knapsack with the maximum possible dollar value of three types of treasure bricks. The treasure bricks available to

 Problem to solve: - Fill a single knapsack with the maximum

possible dollar value of three types of treasure bricks. The treasure bricks

Problem to solve: - Fill a single knapsack with the maximum possible dollar value of three types of treasure bricks. The treasure bricks available to fill the sack have the following specifications: - Treasure A: size 8 cubic cm, and is worth $40 - Treasure B: size 3 cubic cm, and is worth $10 - Treasure C: size 1 cubic cm, and is worth $2 - Fill the sack so that the size of the sack is equivalent to the combined sizes of all the treasure in the sack - After filling the sack, display the number and value of each type of brick in the sack, and the total value of the bricks in the sack Program output: - Output when user enters 76 Enter the size of the sack: 76 A knapsack of size 76 cubic cm can contain the following: A bricks: 9, worth $360 B bricks: 1, worth $10 C bricks: 1, worth $2 The total value collected: $372

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!