The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Having some trouble with the JAVA code on this one.Â
Â
(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of 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 89.5 142 166.3 93
(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 89.5 142 166.3 93 Total weight: 726.8 Average weight: 145.36 Max weight: 236
-----------