Question: The object of this exercise is to write a program to process a set of student marks by reading them from an input file. The
The object of this exercise is to write a program to process a set of student marks by reading them from an input file. The program should write its output to the standard output. Each line of the input file follows this format: a name (which may be considered as a unique key for the purpose of this assignment) followed by a mark. An example is given below which lists marks for three students, Simon, Anna, and Edward. Each name will be a single word. Simon 4 Anna 10 Simon 4 Anna 9 Anna 5 Edward 10 . Once the input has been processed, the next step is to create the output. This should be listed in two ways and written to the standard system out console. The first list should be in alphabetic order, the second list should be in merit order. For each student in each list print the number of marks and the average. Each list should be preceded by a title. . After both lists have been printed, print the number of students, the average of the student averages (this is not the same as the average of all the marks processed), and the standard deviation of the student averages (i.e. in the example below, this would be the s.d. of 10.0, 8.0, 4.0). Processing the above input data should produce the following output. All floating point numbers should be printed to one decimal place. When printing the merit order each line should begin with the rank in the merit order, as shown below. Take care to correctly handle cases where two or more students have the same average (they should be listed as having equal rank). . Alpha order . Anna 3 8.0 . Edward 1 10.0 . Simon 2 4.0 . . Merit order . 1 Edward 1 10.0 . 2 Anna 3 8.0 . 3 Simon 2 4.0 . . Number of students: 3 . Average student mark: 7.3 . Standard deviation: 3.1 . . Your code should make appropriate use of Java Collection classes. . All these statistics can be calculated by storing all the numbers in appropriate collections and performing the calculations by accessing the collections.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
