Answer:
Replace /* Your solution goes here */ with:
cin>>matchValue;
numMatches = 0;
for (i = 0; i < userValues.size(); ++i) {
if(matchValue == userValues.at(i))
{
numMatches++;
}
}
Explanation:
This line gets input for matchValue
cin>>matchValue;
This line initializes numMatches to 0
numMatches = 0;
The following iteration checks for the number of matches (numMatches) of the matchValue
for (i = 0; i < userValues.size(); ++i) {
if(matchValue == userValues.at(i))
{
numMatches++;
}
}
See Attachment for full source code