A grade text file was provide that has one integer number per line representing
ID: 3662999 • Letter: A
Question
Explanation / Answer
import java.util.Scanner; import java.io.FileInputStream; import java.io.FileNotFoundException; public class GradeHistogram{ public static void main(String[] args) throws Exception { Scanner gradeFile = new Scanner(new FileInputStream("grades.txt")); int counter = 0; while (gradeFile.hasNextLine()) { gradeFile.nextLine(); counter++; } int[] grades = new int[counter]; System.out.println("Grades loaded!"); System.out.println("What bucket size would you like?"); Scanner output = new Scanner(System.in); for (int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.