Answered step by step
Verified Expert Solution
Question
1 Approved Answer
plz solve it using java 1 of 386 31 Question 1) Sabziwala - the vegetable vendor problem Harilal is a local vegetable vendor. Sometimes he
plz solve it using java
1 of 386 31 Question 1) Sabziwala - the vegetable vendor problem Harilal is a local vegetable vendor. Sometimes he sells fruits too depending on his profits and available stock in the wholesale. Early morning around 4 am he visits the Rythubazar - the local wholesale farm and buys objects that he can sell. Here is your data, you will be the given the items that he can carry such as Cauliflower, Brinjal, or even fruits like apple, oranges etc. You will be given the weight of each item. You will be given the maximum weight of his basket that he can carry and the profit in Rs that he makes per item. Device a strategy to maximize his profit in one trip. Example On a particular day he can buy the following items in the Rythubazar - Potatoes, Bell pepper, Banana and Watermelon Their weights respectively are 2Kg, 3Kg. 1 kg and 4kg Respective profit on each item respectively is Rs4, Rs5, Rs3 and Rs7 But the maximum weight that he can carry is only 5Kg. The answer for the above example is 5 banana's that will fetch him the profit of Rs. 15 Your logic should work by changing the above data (for example change the number of items or their weights or their profits or the maximum weight that he can carry when his son joins him). OR 12:33Step by Step Solution
There are 3 Steps involved in it
Step: 1
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