Question: 4.5 People's weights (Java) 1) Prompt the user to enterve numbers, being ve people's weights. Store the numbers in an array 01' doubles. Output the


4.5 People's weights (Java) 1) Prompt the user to enterve numbers, being ve people's weights. Store the numbers in an array 01' doubles. Output the array's numbers on one line, each number followed by one space. (2 pts) Ex: Enter weight 1: 236 Enter weight 2: 89.5 Enter weight 3: 142 Enter weight 4: 166.3 Enter weight 5: 93 You entered: 236.0 89.5 142.0 166.3 93.0 2) Also output the total weight, by summing the array's elements. [1 pt) 3) Also output the average of the array's elements. ('1 pt) 4) Also output the max array element. [2 pts) Ex: Enter weight 1: 236 Enter weight 2: 89.5 Enter weight 3: 142 Enter weight 4: 166.3 Enter weight 5: 93 You entered: 236.0 89.5 142.0 166.3 93.0 Total weight : 726.8 Average weight: 145 . 35999999999999 Max weight : 236.0 440066.2818008.qx3zqy7 LAB ACTIVITY 4.5.1: People's weights (Java) 0 / 6 PeopleWeights.java Load default template... import java. util . Scanner; NP public class Peopleweights { UTA W public static void main(String args) { /* Type your code here. */ 6 return; 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
