I'm writing a program now that takes a ID and 3 numbers fom a text file each in a line such as "23AFS 98 34.3 99" on each line, seperated by a space each. Im using a scanner and filereader to get the information from the file but Im not sure as to how I can set these numbers so that I can get the average, min value, max value etc.
Here is the code for the filereader.
try
{
FileReader reader = new FileReader("scores.txt");
Scanner in = new Scanner(reader);
while (in.hasNext())
{
String line = in.next();
}
}
catch (IOException exception)
{
System.out.println("Error procession file: " + exception);
}
If anymore information is needed, just ask. Mainly I just need to set it up as each ID in a variable and each number in a variable, I think thats what I have to do but I can't figure it out exactly, and is this the best way to do it? Thanks.