[Fractional Knapsack Problem] Explain each line of code also the…

Question Answered step-by-step [Fractional Knapsack Problem] Explain each line of code also the… [Fractional Knapsack Problem] Explain each line of code also the flow of the program.Image transcription textmain.cpp 1 #include W N using namespace std; 4 5 – struct Item { 6 7 int value, weight; 8Item(int value, int weight) { 10 11 this ->value = value; 12 this->weight = weight; 13 Lp 14 15 16 bool cmp(struct Item a, struct Item b) { 17 18 double r1 = (double)a.value / (double)a.weight; 19 double r2 = (… Show more… Show more  Computer Science Engineering & Technology C++ Programming CS 49c Share QuestionEmailCopy link Comments (0)