So here is the deal:

The program below is intended to find the arithmetic mean of the numbers stored in the array q in two ways: once by storing the numbers in an ArrayList d, where you allow all the necessary conversions to be performed automatically; and once by storing them in an ArrayList e, where you perform all the conversions by hand. Complete the program.

Here is what I have so far:

Code Java:

double[] q = { 0.5, 2.4, 7.4, 2.8, -6.2 }; ArrayList<Double> d = new ArrayList<Double>(); ArrayList<Double> e = new ArrayList<Double>(); for ( double x : q ) { d.add( x ); e.add ( new Double ( x ) ); } double dTotal = 0.0, eTotal = 0.0; for (double c : d) { double a += c; } for (double f : e) { double b += f; } return (dTotal / d.length); return (eTotal / e.length);

--- Update ---

I switched it a little bit. It still gives me the same error:

Code Java:

--- Update ---

Why does it still show "a / d.size?" I thought I fixed that. Whatever, it's supposed to be "dTotal / d.size()", etc.