Write a java program that: - - reads the weight of 5 boxes as double number...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these databases questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Refer to Figure 14.3. Select a year when the gallons of oil spilled were over 15 million. Research the spill(s) for that year. Was the amount due to one oil spill or multiple oil spills?Investigate...
-
On December 31, 2019, Regent plc rendered services to Begin Group at an agreed price of 102,049, accepting 40,000 down and agreeing to accept the balance in four equal installments of 20,000...
-
Continue or discontinue a segment? The segmented income statement for XYZ Company for the year ended December 31, 2013, follows: The company is concerned about the performance of product A, and you...
-
Suppose you make 15 equal annual deposits of \($1,000\) each into a bank account paying 5% interest per year. The first deposit will be made one year from today. How much money can be withdrawn from...
-
What contemporary factors are contributing to the internationalization of the subject of accounting?
-
2) Convert the following signed numbers to decimal by using 2's complement. (a) 01111101 (b) 10000000 (c) 11111111 (d)00000000 (e) 11110101
-
Do you Wordle? The object of the game is to discover a 5-letter word in 6 tries or less. A claim is made that the mean number of vowels in 5-letter words is 2. You want to test this hypothesis and...
-
ABC Medical, a medical distributor of hospital beds, purchases its beds from a manufacturer for $2,200. If the distributor's policy is to mark up all merchandise 20% based on selling price, what...
-
What were the closing prices on the stock market for 8/12/2006, they are as follows: Apple, Inc., Microsoft Corp, Amazon, Alphabet, Coco-Cola?
-
What would you earn in total commissions on following sales of $5100, $4876, $5215, $6225 and $ 5235. If you earned a commission rate of 1.5% ?
-
Explain what a bank needs in order to make a loan. How would you calculate whether the bank has what it needs to make a loan?
-
In personal risk evaluation and the decision of how much insurance to purchase, one important consideration is the current and future earnings. In homework assignment 2, you will try to find the...
-
Can you please explain the pros and cons of financing choices for Ralph Lauren Corp. What are some advantages of debt? What are disadvantages of debt?
-
Suppose that IQs of adult Canadians follow a normal distribution with a standard deviation of 15. A random sample of 25 adult Canadians has a mean IQ of 112. a. The margin of error for a 93%...
-
Consider the sections of two circuits illustrated above. Select True or False for all statements.After connecting a and b to a battery, the voltage across R1 always equals the voltage across R2.Rcd...
-
Consider the following fragment of code: if (x > 5) { System.out.println("A"); if (x < 10) System.out.println("B"); } else System.out.println("C"); What is displayed if x is a. 4; b. 5; c. 6; d. 9;...
-
Write a JavaFX program that moves an image toward the location of the mouse. The image shouldnt jump directly to the mouse coordinates (which is what happens in Listing 9.16) but should move a few...
-
Repeat the previous programming project, but read the input data from a file and send the output to another file. If you have covered binary files, use binary files; otherwise, use text files. Read...
-
Do you know about the chart of accounts in your organization as it pertains to information you receive?
-
If you receive reports in the course of your work, do you believe that they are prepared for outside (third party) use or for internal (management) use? What leads you to believe this?
-
If so, is it similar to one of the three formats illustrated in this chapter? If not, how is it different?
Study smarter with the SolutionInn App