Write a program that uses an array to find the average of


1. Show two ways to declare a one-dimensional array of 12 doubles.
{1.0, 2.0, 3.0, 4.0, 5.0, 6.0,7.0, 8.0, 9.0, 10.0, 11.0, 12.0};
For the first example print the 7.0 and 10.0 in a println.
Example - Your println should match
7.0
10.0
For the first example print the 2.0 and 12.0 in a println.
Example - Your println should match
2.0
12.0

2.Write a program that uses an array to find the Average of 10 double values.
Use Math.random() in combination with a for loop to fill the array with 10 random values.
Then use a different for loop to iterate through the array when summing the total for all 10 double values.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program that uses an array to find the average of
Reference No:- TGS02394954

Now Priced at $10 (50% Discount)

Recommended (92%)

Rated (4.4/5)