Java Application – ArrayStatistics

Java Application – ArrayStatistics

Name the Java Class:  ArrayStatistics

Create a Java application that contains methods to display statistics for the exam scores in an array.

The main method has been written for you.  Upload ArrayStatistics.java from Moodle and complete the program by writing the following methods.

fillArray Method:  Read the grades from a file named ExamScores.txt.  The first number in the file is the number of exams follows by the exam scores.  Create an array of the size indicated and fill it with exam scores from the file.  After the exams are loaded, sort the array.  Return the array to the calling method.

displayGrades Method:  Receive the array as an argument and display the count for each letter grade (A, B, C, D, F).  Letter grades are determined as follows:

Score    Letter Grade

90-100        A
80-89        B
70-79        C
60-69        D
Below 60        F

frequencyChart Method:  Receive the array as an argument and display a frequency chart for each exam score in the array.  Display an asterisk for each distinct score found.

getMode Method:  Receive the array as an argument and return the mode.  If there are duplicate numbers for the mode, simply return the first number.

getAverage Method:  Receive the array as an argument and return the average of exam scores found in the array.

getStandardDeviation:  Receive the array and the average as arguments and return the standard deviation.  Use the formula for standard deviation shown in exercise 7.11 on page 278 of the text.

Upload the ExamScores.txt file from Moodle and use it for the input in your assignment.

Program output should look like this:
Grading Rubric

ArrayStatistics.java

•    Correct File Name (ArrayStatistics.java) – case sensitive
•    Correct Class Name (ArrayStatistics) – case sensitive
•    Correct Style – comments for each method
•    Correct Style – indentation
•    Correct Style – White Space
•    Free of syntax errors
•    Using main method supplied on Moodle with no changes
•    Using ExamScores.txt file supplied on Moodle
•    Method fillArray
o    Open and read ExamScores.txt file
o    Create array of correct size from 1st record in file
o    Fill array with scores from file
o    Sort the array
o    Return the array
•    Method displayGrades
o    Receive array as parameter
o    Total the scores for each letter grade
o    Display the totals
•    Method frequencyChart
o    Receive array as parameter
o    Display correct number of asterisks for each score
•    Method getMode
o    Receive array as parameter
o    Calculate correct mode
o    Return mode to caller
•    Method getAverage
o    Receive array as parameter
o    Calculate correct average
o    Return average to caller
•    Method getStandardDeviation
o    Receive array as parameter
o    Calculate correct standard deviation
o    Return standard deviationto caller

Upload

Upload the source code file (ArrayStatistics.java) using your Moodle account for the course into “Assignment 8 Submission”

find the cost of your paper