![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 17.06.2021 17:40 ShawnBrains
Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 2, 1, 2} and matchValue is 2 , then numMatches should be 3.
Your code will be tested with the following values:
* matchValue: 2, userValues: {2, 2, 1, 2} (as in the example program above)
* matchValue: 0, userValues: {0, 0, 0, 0}
* matchValue: 50, userValues: {10, 20, 30, 40}
#include
#include
using namespace std;
int main() {
const int NUM_VALS = 4;
int matchValue;
unsigned int i;
int numMatches = -99; // Assign numMatches with 0 before your for loop
vector userValues(NUM_VALS);
cin >> matchValue;
for (i = 0; i < userValues. size(); ++i) {
cin >> userValues. at(i);
}
/* Your solution goes here */
cout << "matchValue: " << matchValue << ", numMatches: " << numMatches << endl;
return 0;
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 22:30
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
![question](/tpl/images/cats/informatica.png)
You know the right answer?
Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NU...
Questions
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/himiya.png)
Chemistry, 29.11.2021 19:40
![question](/tpl/images/cats/mir.png)
World Languages, 29.11.2021 19:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 29.11.2021 19:40
![question](/tpl/images/cats/mat.png)
Mathematics, 29.11.2021 19:40
![question](/tpl/images/cats/mat.png)
Mathematics, 29.11.2021 19:40
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
English, 29.11.2021 19:40
![question](/tpl/images/cats/pravo.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 29.11.2021 19:40
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)