Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include <iostream> // include vector library using namespace std; //Function pr

ID: 3920046 • Letter: #

Question

#include <iostream>
// include vector library
using namespace std;

//Function prototype
double weightSummary(vector<double>);

int main() {
vector<double> list1; //Do NOT modify this vector declaration






//Do NOT modify these last two statements
double showResults = weightSummary(list1);
return 0;
}

//Function definition
double weightSummary(vector<double> v){
// Type your code here

}

(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in a vector of doubles. Output the vector's numbers on one line, each number followed by one space. (2 pts) Example output: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142. 0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236 89.5 142 166.3 93 (2) Also define and call a double returning function, weightSummary, that accepts the vector as a parameter, and does the following .(a) output the total weight, by summing the vector's elements. (1 pt) ..) output the average of the vector's elements. (1 pt) (c) output the max vector element. (2 pts) ..)returns the sum of the total weight, average and max vector element. 4 pts) **Quick note: weightSummary is already called for you in the starter code below**

Explanation / Answer

#include #include // include vector library using namespace std; //Function prototype double weightSummary(vector); int main() { vector list1; //Do NOT modify this vector declaration double w; for(int i = 0; i < 5; i++) { cout