Question: Write a java program that: - - reads the weight of 5 boxes as double number from the user the box weight should not
Write a java program that: - - reads the weight of 5 boxes as double number from the user the box weight should not exceed 25.0 kg, otherwise a message is given to re-enter weight calculate the average weight - print the average weight Output Sample: Sample 1 Box#1 weight = 12.5 Box#2 weight = 22.7 Box#3 weight = 17.2 Box#4 weight = 10.4 Box#5 weight = 9.5 Boxes average weight is: 14.46 kg Sample 2 Box#1 weight = 10.9 Box#2 weight = 21 Box#3 weight = 11.8 Box#4 weight = 25.9 Weight should not exceed 25 Box#4 weight = 25 H Box#5 weight = 19.5 Boxes average weight is: 17.64 kg Sample 3 Box#1 weight = 27 Weight should not exceed 25 Box#1 weight = 17 Box#2 weight = 22 Box#3 weight = 13.8 Box#4 weight = 5.5 Box#5 weight = 7.6 Boxes average weight is: 13.18 kg
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
