Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integer numIn is read from input. Given the integer vector hourlyPrices with the size of numIn, assign numMatches with the number of integers in userValues

Integer numIn is read from input. Given the integer vector hourlyPrices with the size of numIn, assign numMatches with the number of integers in userValues that are equal to 4.
#include
#include
using namespace std;
int main(){
int numIn;
int numMatches;
unsigned int i;
cin >> numIn;
// Creates a vector of size numIn and initializes all values to 0
vector hourlyPrices(numIn);
for (i =0; i < hourlyPrices.size(); ++i){
cin >> hourlyPrices.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_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

3. Have the group identify common themes.

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago