I'm supposed to be taking all the averages of the students grades and create an overall average...but it's not working
import java.io.*;
import java.util.*;
public class Grade
{
public static void main(String[] args) throws IOException
{
String []name = new String[50];
int num1, num2, num3;
Scanner inFile =
new Scanner(new FileReader("Average.txt"));
int []average = new int[50];
double sum;
int c = 0;
while(inFile.hasNext())
{
name[c] = inFile.next();
num1 = inFile.nextInt();
num2 = inFile.nextInt();
num3 = inFile.nextInt();
average[c]=((num1 + num2 + num3)/3);
c++;
}
for (int i = 0; i < c; i++)
{ System.out.println(name[i] + " " + average[i]);
}
for (int i = 0; i < average.length; i++)
{
sum += average[i] * (c));
}
}
}
it's the sum that isn't working...any ideas?...sorry to be so vague