Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C code please! You need to maximize the value to weight ratio. Please provide with the input and output as shown in the image only.

image text in transcribed

C code please!

You need to maximize the value to weight ratio.

Please provide with the input and output as shown in the image only.

Please provide correct and working code, If the code works I will upvote for sure. Or else I will downvote. Thank You...

Write a C program to solve the fractional knapsack problem. For example, the weights and values of 3 divisible items are given in the table below. The capacity of the knapsack bag is 50. Find an optimal solution to maximize the value to weight ratio. Item Weight Value 1 10 $60 12. 20 $100 3 0 $120 Note: Read knapsack capacity, number of items, weights of items and profits of items from the user. Print the solution. Round the solution to one fractional digit after decimal point. For example the solution for the above problem would be 1.0 1.0 0.7 For example: Input Result 50 1.0 1.0 0.7 3 10 20 30 60 100 120

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

Use squeeze theorem -F cos Use the squeeze theorem to evaluate:

Answered: 1 week ago