Question: Integer dataSize is read from input. Then, dataSize pairs of strings and integers are read and stored into string vector groceryList and integer vector quantityList,

Integer dataSize is read from input. Then, dataSize pairs of strings and integers are read and stored into string vector groceryList and integer vector quantityList, respectively. Lastly, string groceryAsked and integer quantityAsked are read from input. Complete the following tasks:
Initialize matchesFound with 0.
Use a loop to increment matchesFound, a counter that tracks the number of element pairs that match both groceryAsked and quantityAsked. For each pair that matches groceryAsked and quantityAsked, output "Found at index " followed by the element pair's index. End with a newline

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 Programming Questions!