Question: Can you Please Properly Solve the following Problem for me, Thank you! Use Java (preferably NetBeans) to solve the following Problem: Alex walks inside a

 Can you Please Properly Solve the following Problem for me, Thank

Can you Please Properly Solve the following Problem for me, Thank you! Use Java (preferably NetBeans) to solve the following Problem: Alex walks inside a candy store holding a thin bag. He has limited time to gather as much candy as he can, but he must take care to keep the bag from tearing. The shop has a set quantity of candies, each with a unique weight and sentimental worth. Naturally, he wants to stuff as many candy pieces as he can into the bag while also getting as many of the finest kinds. Help him select the candies that he must put in the bag as well as the ones that he must keep at the store? Input: > The first line contains the integer N, which represents the quantity of candies in the store. Next come three lines. In the second line, there are N integers, where Ni is the candy's sentimental value to Alex. N integers are found in the third line, where Ni is the weight of each candy. The final line provides an integer W that represents the bag's maximum allowable weight. Example: Note: Use Scanner Method so I can test different Sample Inputs. Also provide the code I in proper format and comments that I can copy and understand properly. Please show output as well

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!