Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a program that receives the list of possible named items with the following information: o Value ($), Height (in), Width (in), Depth (in)
Create a program that receives the list of possible named items with the following information: o Value ($), Height (in), Width (in), Depth (in) 1. The limit of the optimal solution is expressed by the volume in cubic inches (in) and the program has to maximize the value within the cubic limit 2. Your program should read a textual file with one item type per line with the information separated by comma, for example this file lists four items with values 35, 40, 45, and 58 dollars and increasing dimensions 3. Your program should capture the overall limit of the package/knapsack from the user. 4. Your program should read any file with this format (name, value, height, width, depth) per line 5. Your program must print out the best distribution with a string like: "The suggested items are: 72 Milky Ways and 5 Tootsie Rolls with a total value of $53. There were 4 square inches left unused." 6. The printed statement must at least include: names of items included; number of items included; total profit; leftover space. 1 2 3 4 small medium large jumbo A B 35 40 45 58 3 4 5 (O) 6 4 5 6 6 E 2 4 5 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To solve the knapsack problem with the given requirements you can use dynamic programming Heres a Py...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started