Snippet of my code:
...
System.out.println("\t" + "MONTH |" + "\t" + "HIGH | " + "\t" + "LOW |" + "\t" + "AVERAGE |" + "\t" + "RANGE");
System.out.println("\t" + "______________________________________________");
main.averageMonthOne(hightemp, lowtemp);
in1.close();
out.close();
}//end of main
private static double averageMonthOne (int hightemp, int lowtemp)
{
double avgM = (hightemp + lowtemp)/2;
System.out.println(avgM);
return avgM;
}
I want to be able to use the average I received from averageMonthOne
and place it respectively under a the word "AVERAGE" in the println. Is that possible?
Expected Output:
MONTH | HIGH | LOW | AVERAGE | RANGE
_____________________________________
30.0