Question: C++ Integer inputSize is read from input. Then, strings and integers are read and stored into string vector foodList and integer vector quantityList, respectively. Lastly,

C++

C++ Integer inputSize is read from input. Then, strings and integers areread and stored into string vector foodList and integer vector quantityList, respectively.Lastly, string foodAsked is read from input. - Find the sum of

Integer inputSize is read from input. Then, strings and integers are read and stored into string vector foodList and integer vector quantityList, respectively. Lastly, string foodAsked is read from input. - Find the sum of the elements in quantityList where the corresponding element in foodList is equal to foodAsked. - For each element in foodList that is equal to foodAsked, output "Index " followed by the element's index. End with a newline. Ex: If the input is: 4 yuca 188 guava 33 guava 56 guava 55 guava Then the output is: Index 1 Index 2 Index 3 Total: 144 for (i=0;i> foodList.at (i); cin>> quantityList. at (i); \} fin >> foodAsked; Your code goes here / cout

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!