Question: Jump to level 1 Integer vecvals is read from input as the number of elements in vector hourlyscores. Given the integer vector hourlyscores, write a

Jump to level 1
Integer vecvals is read from input as the number of elements in vector hourlyscores. Given the integer vector hourlyscores, write a
for loop that assigns sumvalues with the sum all the integers in hourlyscores that are less than 119.
Ex: If the input is:
3
109,119,137
then the output is:
Sum of values below 119: 109
#include iostream>
#include vector
using namespace std;
int main (){
vector (int) hourlyscores;
int vecyals;
int sumbalues;
unsigned int i;
int score;
cin vectals;
for ; i vectals; ++i){
cin s score;
hourlyscores . push_back (score);
}
/* Your solution goes here */
cout "Sum of values below 119: " sumValues endl;
return 0;
}
 Jump to level 1 Integer vecvals is read from input as

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 Databases Questions!