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:
3
broccoli 90 onion 68 potato 13
broccoli
Then the output is:
The product broccoli matches the label 90, found at index 0
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 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!