Engineering Questions

IN JAVA,Knapsack ProblemThe file KnapsackData1.txt and KnapsackData2.txt are sample input filesfor the following Knapsack Problem that you will solve.KnapsackData1.txt contains a list of four prospective projects for the upcoming year for a particularcompany:Project0 6 30Project1 3 14Project2 4 16Project3 2 9Each line in the file provides three pieces of information:1) String: The name of the project;2) Integer: The amount of employee labor that will be demanded by the project, measured in work weeks;3) Integer: The net profit that the company can expect from engaging in the project, measured in thousandsof dollars.Your task is to write a program that:1) Prompts the user for the number of work weeks available (integer);2) Prompts the user for the name of the input file (string);3) Prompts the user for the name of the output file (string);4) Reads the available projects from the input file;5) Dolves the corresponding knapsack problem, without repetition of items; and6) Writes to the output file a summary of the results, including the expected profit and a list of the bestprojects for the company to undertake.Here is a sample session with the program:Enter the number of available employee work weeks: 10Enter the name of input file: KnapsackData1.txtEnter the name of output file: Output1.txtNumber of projects = 4DoneFor the above example, here is the output that should be written to Output1.txt:Number of projects available: 4Available employee work weeks: 10Number of projects chosen: 2Number of projectsTotal profit: 46Project0 6 30Project2 4 16The file KnapsackData2.txt, contains one thousand prospective projects. Your program should also be able to handle this larger problem as well. The corresponding output file,WardOutput2.txt, is below.With a thousand prospective projects to consider, it will be impossible for your program to finish in areasonable amount of time if it uses a "brute-force search" that explicitly considers every possiblecombination of projects. You are required to use a dynamic programming approach to this problem.WardOutput2.txt:Number of projects available: 1000Available employee work weeks: 100Number of projects chosen: 66Total profit: 16096Project15 2 236Project73 3 397Project90 2 302Project114 1 139Project117 1 158Project153 3 354Project161 2 344Project181 1 140Project211 1 191Project213 2 268Project214 2 386Project254 1 170Project257 4 427Project274 1 148Project275 1 212Project281 2 414Project290 1 215Project306 2 455Project334 3 339Project346 2 215Project356 3 337Project363 1 159Project377 1 105Project389 1 142Project397 1 321Project399 1 351Project407 3 340Project414 1 266Project431 1 114Project435 3 382Project446 1 139Project452 1 127Project456 1 229Project461 1 319Project478 1 158Project482 2 273Project492 1 142Project525 1 144Project531 1 382Project574 1 170Project594 1 125Project636 2 345Project644 1 169Project668 1 191Project676 1 117Project684 1 143Project689 1 108Project690 1 216Project713 1 367Project724 1 127Project729 2 239Project738 1 252Project779 1 115Project791 1 110Project818 2 434Project820 1 222Project830 1 179Project888 3 381Project934 3 461Project939 3 358Project951 1 165Project959 2 351Project962 1 316Project967 1 191Project984 1 117Project997 1 187