Howdie:
I have issues with this program:
package Scores;
import java.io.*;
import java.util.*;
import java.util.Scanner.*;
public class Scores {
public static void main(
String[] args) throws Exception {
int total=0;
int count=0;
// Create a File instance
java.io.File file = new java.io.File("Scores.txt");
// Create a Scanner for the file
java.util.Scanner input = new java.util.Scanner(file);
// Read data from a file
while (input.hasNext()) {
count=count+1;
int score = input.nextInt();
total = total + score;
}
average = total / count;
System.out.println("The total = " +total +"\n"
+ "The average = " +average);
// Close the file
input.close();
}
}
With the Scores.txt containing the following:
55 88 99 50 66 31 45 15 48
Mucho Gracias!