Question: This is C++ Assignment. CHALLENGE 5.4.2: Finding values in vectors ACTIVITY Set numMatches to the number of elements in userValues (having NUM VALS elements) that

This is C++ Assignment.

This is C++ Assignment. CHALLENGE 5.4.2: Finding values in vectors ACTIVITY Set

CHALLENGE 5.4.2: Finding values in vectors ACTIVITY Set numMatches to the number of elements in userValues (having NUM VALS elements) that equal matchValue. Ex: If matchvalue-2 and uservalues-12, 2, 1, 2}, then numMatches-3. (Notes) 1 #include iostream 2 #include 3 using namespace std; 1 test passed 4 5 int main) const int NUM VALS 4; 7 vector userValues (NUMVALS) All tests passed 8 unsigned int i; 9 10 int matchValue; int numMatches -99; // Assign numMatches with 0 before your for loop 12 userValues.at(0) - 2; 13 userValues.at(1) -2; 14 userValues.at(2) 1; 15 userValues.at(3)=2; 16 17 matchvalue=2; 18 19 Your solution goes here/ 20 21 Cout

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!