Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

4. How is culture a contested site?

Answered: 1 week ago