I am trying to return two double values from the class. The code is ;

public double[] calculations (double rain[], double evaptrans[], double cistern_water[]) //Does not need to receive vectors as arguments. Single daily values are most appropriate ~CJM

{ sws= RZ*AWHC; // I recommend renaming this variable as AWHC = Available water holding capacity ( =FC-PWP). Rename rooting depth as RZ. Specify the units of your calculations in comments.~CJM

/* All units are in inches and gallons ~ JPP

*/

mad= sws*allowablecoefficient; //What is the allowable coefficient? I do not know what this is. ~CJM // An availability coefficient is used

/* to calculate the percentage of water that is readily available to the plant, ie the amt of stored water

* a plant can extract from the soil without getting stressed (ref: British Columbia, Ministry of agriculture ~ JPP

*/

initialsoilwaterbalance= 0;

AD = mad/0.75;

System.out.println ("mad= " +mad); //MAD should be an input not a calculated value ~CJM // MAD is calculated above as mad= sws *allowablecoefficient ~JPP

double[] etc = new double [evaptrans.length]; //No need for vectors. This method should just handle "today's" numbers. This makes it more complicated than is needed. ~CJM // ?? ~JPP

double[] netsoilwaterbalance = new double [rain.length];

double[] netsoilwb_area = new double [rain.length]; //Is the net area different than another area? ~CJM // netsoilwaterbalance gives the value per unit area while netsoilwb_area calculates for given area ~ JPP

double[] waterreqdforirrigation = new double [rain.length];

double[] waterreqdforirrigation_area = new double [rain.length];

double farm_area = 108000; // sq.inches ~ JPP

double[] updated_cistern_water = new double [rain.length];

/** for turf grass of area 750 sq.ft */

for (int j=0; j<evaptrans.length; j++)

{ etc[j] = evaptrans[j] * kc;

}

for (int i=0;i<rain.length;i++)

{

a=i+1;

netsoilwaterbalance[i] = initialsoilwaterbalance + rain[i] - etc[i];

netsoilwb_area[i] = netsoilwaterbalance[i]*farm_area;

System.out.println ("the amount of water in the soil on day " + a + " is " + netsoilwb_area[i]);

initialsoilwaterbalance = netsoilwaterbalance[i];

if (netsoilwaterbalance[i] <= mad)

{

System.out.println ("Irrigation is required on day " + a); //Not necessarily. It depends on the thresholds for irrigation, even if based on storage. ~CJM // ?? ~JPP

waterreqdforirrigation[i] = AD - netsoilwaterbalance[i];

waterreqdforirrigation_area[i] = waterreqdforirrigation[i] * farm_area;

if (cistern_water[i] <= waterreqdforirrigation[i] )

{ System.out.println ("water equal to " + waterreqdforirrigation_area[i] + " to be supplied from secondary source on day " +a);

}

else if (cistern_water[i] >= waterreqdforirrigation[i] )

{ System.out.println ("water to be released from cistern on day " + a +" is " +waterreqdforirrigation_area[i]);

cistern_water[i+1] = cistern_water[i+1] - cistern_water[i];

updated_cistern_water [i] = cistern_water[i+1];

}

}

else

{ System.out.println ("Irrigation is not required on day " +a);

waterreqdforirrigation[i] = 0.0;

}

}

return waterreqdforirrigation_area;

return updated_cistern_water;

}

It shows error :-

Unreachable statement for "updated_cistern_water"