Question: c++ Integer vecVals is read from input. Given the integer vector yearlyPrices with the size of vecVals, write a for loop that sums each integer
c++
Integer vecVals is read from input. Given the integer vector yearlyPrices with the size of vecVals, write a for loop that sums each integer of yearlyPrices together until either maxSum is greater than or equal to 450 or the end of the vector is reached.
Ex: If the input is
3
85 87 106
then the output is:
maxSum: 278
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
