Question: Integer numElements is read from input. Then, integers and strings are read and stored into integer vector labelList and string vector foodList, respectively. Lastly, integer
Integer numElements is read from input. Then, integers and strings are read and stored into integer vector labelList and string vector foodList, respectively. Lastly, integer labelAsked is read from input. Find labelAsked in labelList and output the following:
"Index
the index of labelAsked in labelList
: the label
the value of labelAsked
has value
the element in foodList at the index of labelAsked in labelList
End with a newline.
Ex: If the input is:
eggplant bamboo gourd
Then the output is:
Index : the label has value bamboo
Note: labelAsked is an element in labelList.
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
