Question: Output each floating - point value with two digits after the decimal point, which can be achieved by executing cout fixed setprecision ( 2 )
Output each floatingpoint value with two digits after the decimal point, which can be achieved by executing
cout fixed setprecision; once before all other cout statements.
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. pts
Ex:
Enter weight :
Enter weight :
Enter weight :
Enter weight :
Enter weight :
You entered:
Also output the total weight, by summing the vector's elements. pt
Also output the average of the vector's elements. pt
Also output the max vector element. pts
Ex:
Enter weight :
Enter weight :
Enter weight :
Enter weight :
Enter weight :
You entered:
Total weight:
Average weight:
Max weight:
Enter weight :
Enter weight :
Enter weight :
You entered:
Also output the total weight, by summing the vector's elements. pt
Also output the average of the vector's elements. pt
Also output the max vector element. pts
Ex:
Enter weight :
Enter weight :
Enter weight :
Enter weight :
Enter weight :
You entered:
Total weight:
Average weight:
Max weight:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
