import java.io.*;
import java.util.*;
import java.awt.*;
public class weather {
public static void main
(String[] args
)
Scanner input
= new Scanner
(new File("PortlandWeather2011.txt"));
int count = 0;
while (input.hasNextLine()) {
process(input);
count++;
}
double[] precip = new double[count];
double[] snow = new double[count];
double[] snowDepth = new double[count];
double[] tempMin = new double[count];
double[] tempMax = new double[count];
input
= new Scanner
(new File("PortlandWeather2011.txt"));
x = input.nextLine();
y = input.nextLine();
count = 0;
while (input.hasNextLine()) {
input.next();
input.next();
precip[count] = input.nextDouble();
snow[count] = input.nextDouble();
snowDepth[count] = input.nextDouble();
tempMax[count] = input.nextDouble();
tempMin[count] = input.nextDouble();
count++;
}
System.
out.
println(arrayAvg
(precip
)); System.
out.
println(arrayAvg
(snow
)); System.
out.
println(arrayAvg
(snowDepth
)); System.
out.
println(arrayAvg
(tempMin
)); System.
out.
println(arrayAvg
(tempMax
)); }
public static double arrayAvg(double a[]) {
int count = 0;
double sum = 0;
for (int i = 0; i < a.length; i++) {
count++;
if (a[i] != 393.7) {
sum += a[i];
}
}
return sum/count;
}
public static void process(Scanner input) {
while (input.hasNext()) {
String station
= input.
next();
while (input.hasNextInt()) {
while (input.hasNextInt()) {
int precipitation = input.nextInt();
while (input.hasNextInt()) {
int snow = input.nextInt();
while (input.hasNextInt()) {
int snowDepth = input.nextInt();
while (input.hasNextInt()) {
int tempMin = input.nextInt();
while (input.hasNextInt()) {
int tempMax = input.nextInt();
}
}
}
}
}
}
}
}
public static double tempConvert(int n) {
double celsius = (n / 10.0) * 9 / 5 + 32;
return celsius;
}
public static double snowConvert(int n) {
double snowInches = n * 0.03937;
return snowInches;
}
public static double precipitationConvert(int n) {
double rainInches = ((n * 0.03937) / 10);
return rainInches;
}
}