Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The main method of GradeViewer should first useJOptionPane.showInputDialog(..) t

ID: 3613742 • Letter: T

Question

The main method of GradeViewer should first useJOptionPane.showInputDialog(..) to prompt and get the name of theinput file.

Next, read the scores and count the number of A's, B's, ...F's.

The main method of the GradeViewer class should create aninstance of your GradeComponent class passing the counts of theletter grades.

Then the main method should (a) create a JFrame, (b) set itssize and location on the screen, (c) add the GradeComponentinstance and (d) make the JFrame visible.

The GradeComponent constructor will need to have parameters forthe 5 counts of the letter grades.

The public void paintComponents(Graphics g) methodshould use the letter grade counts to draw the histogram, whichshould look like this for the sample input file, grades3.txt :

Explanation / Answer

x.