Question
17.2 Programming Fundamentals 2 Assessment 1 (1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in a vector of
17.2 Programming Fundamentals 2 Assessment 1
(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:
(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)
(b) output the average of the vector's elements. (1 pt)
(c) output the max vector element. (2 pts)
(d) 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**
Example Output:
You may code your solution in your C++ compiler, then copy and paste it in the editor below to test and submit
When running the program here in zyBooks, type your test data in the INPUT box below
#include
//Function prototype double weightSummary(vector
int main() { vector
//Function definition double weightSummary(vector
Enter program input (optional)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started