import java.util.Scanner; import java.io.IOException; import java.io.FileReader; import java.io.BufferedReader; import java.util.Arrays; /* ****************************************************************************** * ExamStatisticsProgram * * This program is designed to compute statistics on a list of exam scores read * from a text file in response to a console prompt. The console program * welcomes the user and asks for the name of the text file to input. The text * file contains the number of scores followed by the list of scores. The * program then computes and displays the following information to the console: * * The number of scores The minimum, maximum, and average scores The number of * A, B, C, D, and F; using a 90-80-70-60 scale The median of the * scores. ***************************************************************************** */ /** ÿ* Created by johnacoakley on 5/28/17. ÿ*/ public class ExamStatisticsProgram { //declarations here? String filename; int score; int A,B,C,D,F; //private int min; //private int max; //private int avg; int min,max, avg; public static void main(String[] args) { // logic here? ExamStatisticsProgram ep = new ExamStatisticsProgram(); Scanner sc = new Scanner(System.in); System.out.println("Enter file name:"); ep.filename = sc.next(); int i=1; int t=0; try { BufferedReader br = new BufferedReader(new FileReader(ep.filename)); ÿÿ ÿ ÿ ÿ ÿ String sCurrentLine; ÿÿ ÿ ÿ ÿ ÿ while ((sCurrentLine = br.readLine()) != null) { if(i ==1) { ÿÿ ÿ ÿ t = Integer.parseInt(sCurrentLine); i =2; } else { ÿÿ ÿ ÿ ep.score = Integer.parseInt(sCurrentLine); if (ep.score>= 90) { ep.A++; } else if(ep.score>=80) { ep.B++; } else if(ep.score>=70) { ep.C++; } else if(ep.score>=60) { ep.D++; } else { ep.F++; } if( ep.min>ep.score) { ep.min = ep.score; } if( ep.max