Question: 5.13 LAB: Working With Weights Create an array of weights, and fill with data from the user with a loop. After gathering all input, you
5.13 LAB: Working With Weights
Create an array of weights, and fill with data from the user with a loop. After gathering all input, you will generate several reports based on the gathered data. First, output the vector's numbers on one line, each number followed by one space.
Ex:
Enter weight 1: 136 Enter weight 2: 89.5 Enter weight 3: 142 Enter weight 4: 166.3 Enter weight 5: 93 You entered 236 89.5 142 166.3 93
Also output the total weight, by summing the vector's elements (1pt) Also output the average of the vector's elements (1pt) Also output the max vector element.
Your final output should resemble:
Enter weight 1: 136 Enter weight 2: 89.5 Enter weight 3: 142 Enter weight 4: 166.3 Enter weight 5: 93 You entered 236 89.5 142 166.3 93 Total weight: 726.8 Average weight: 145.36 Max weight: 236
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
