A12_3: Output of arrays

Top  Previous  Next

Solution: Task 12.3:

 

Add the following two output variables to the output section with id="diurnalout":

<out id="TminCalculated" datatype="DOUBLE" rule="var min=${diurnal.Temperature[0]};for (var temperature : ${diurnal.Temperature}){if(temperature &lt; min){min=temperature}}; return min;" 

description="calculate minimum" />

and

<out id="TmaxCalculated" datatype="DOUBLE" rule="var max=${diurnal.Temperature[0]};for (var temperature : ${diurnal.Temperature}){if(temperature &gt; max){max=temperature}}; return max;" 

description="calculate maximum" />

 

and run a Java Application with your solution to see the results.