Question: Jump to level 1 Integer numValues is read from input. Given the integer vector hourly Temps with the size of numValues, write a for

Jump to level 1 Integer numValues is read from input. Given the integer vector hourly Temps with the size of

Jump to level 1 Integer numValues is read from input. Given the integer vector hourly Temps with the size of numValues, write a for loop to initialize the second half of hourly Temps with the remaining integers read from input. Ex: If the input is: 4 114 118 then the output is: 0 0 114 118 Note: The vector size is always even. 5 int main() { 6 int numValues; 7 unsigned int i; 8 @ 1000 9 cin >> numValues; 10 11 // Creates a vector of size numValues and initializes all values to 0 vector hourlyTemps (numValues); 12 13 14 /* Your code goes here */ 15 16 for (i = 0; i < hourlyTemps.size(); ++i) { cout < < hourlyTemps.at (i) < < " "; 17 18 19 | + @ 10 20 21 } } return 0;

Step by Step Solution

3.33 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To initialize the second half of the hourlyTemps vector with the remaining integers read from input ... View full answer

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