Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

Differentiate between spastic and flaccid paralysis.

Answered: 1 week ago

Question

=+Explain the principle of comparative advantage.

Answered: 1 week ago