Question: C + + Integer numElements is read from input. Then, strings and integers are read and stored into string vector productList and integer vector labelList,
C Integer numElements is read from input. Then, strings and integers are read and stored into string vector productList and integer vector labelList, respectively. Lastly, string productAsked is read from input. Find productAsked in productList and output the following:
"The product
the value of productAsked
matches the label
the element in labelList at the index of productAsked in productList
found at index
the index of productAsked in productList
End with a newline.
Click here for example
Ex: If the input is:
broccoli onion potato
broccoli
Then the output is:
The product broccoli matches the label found at index
Note: productAsked is an element in productList.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
