Question: Write a Java program that asks the user to enter the length of sides for one or more squares. The user indicates the end of

Write a Java program that asks the user to enter the length of sides for one or more squares. The user indicates the end of the input by entering a negative sentinel value that is not used in finding the average values. The average should be a value of type double so that it is computed with fractional part.
Here are some examples of input and output
Input: (Your input must match the following below):
Given a list of squares, provide a list of their sides in inches.
Use a negative number to indicate the end of the list.
I will then tell you the average square area (in inches^2) of all the squares
34-1
Output: (Your output must match the following below): (Average data type should be double)
Average square area of all squares: 12.5in^2
Input:
Given a list of squares, provide a list of their sides in inches.
Use a negative number to indicate the end of the list.
I will then tell you the average square area (in inches^2) of all the squares
8412192233-1
Output: (Average data type should be double)
Average square area of all squares: 359.6666666666667in^2
Input:
Given a list of squares, provide a list of their sides in inches.
Use a negative number to indicate the end of the list.
I will then tell you the average square area (in inches^2) of all the squares
2345-1
Output: (Average data type should be double)
Average square area of all squares: 13.5in^2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!