Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Optimizing Data Collection In Warzones

Authors: Aaget Aamber

1st Edition

B0CQRRFP5F, 979-8869065902

More Books

Students also viewed these Databases questions