Question: Integer vecVals is read from input. Given the integer vector hourlySalary with the size of vecVals, assign numMatches with the number of integers in userValues

Integer vecVals is read from input. Given the integer vector hourlySalary with the size of vecVals, assign numMatches with the number of integers in userValues that are equal to 4. Ex: If the input is: 3 116 131 4 then the output is: Number of 4s in array: 1 #include #include using namespace std; int main() { int vecVals; int numMatches; unsigned int i; cin >> vecVals; // Creates a vector of size vecVals and initializes all values to 0 vector hourlySalary(vecVals); for (i = 0; i < hourlySalary.size(); ++i) { cin >> hourlySalary.at(i); } /* Your code goes here */ cout << "Number of 4s in array: " << numMatches << endl; return 0; }

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!