Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The key learning objective of this assignment is to demonstrate a mastery of user defined classes. The program will use at least three user defined
The key learning objective of this assignment is to demonstrate a mastery of user defined classes. The program will use at least three user defined classes. Create a class to contain the student record. Create a class for the statistical functions. And a program class which contains the main method. Pulling the sorting function into its own class like the statistics would be a good idea as well.
While designing these classes think about the abstraction and encapsulation principles. Consider what would have to change if we added C and D to the letter grade system. Ideally only one class would need to be modified to effect this change.
Read the Exam Records from a File.
Each record in the file contains the last name, first name, and score of the student. The student record class should contain at least that much information. Write a method to robustly read the scores from the Scores.txt file and store them into either an array or an ArrayList of student record objects. If a error is detected reading a student record from the file, the program should report the error on System.err and continue processing.
Assign a Letter Grade to the Score.
At some point letter grades must be associated with each score using the mapping in Table
Table Letter Grade to Score Mapping.
Grade Grade Points
A score
A score && score
B score && score
B score && score
B score && score
C score && score
C score && score
D score && score
D score && score
F score
Print The Details.
Print a blank line, the title, Results from the Midterm Exam and another blank line.
Print the heading StudentScore and Grade The S in Student should start in column The S in Score should start in column The G in Grade should start in column The next line should have dashes under Student dashes under Score and dashes under Grade
Sort the student records by last name. You may use the Arrays.sort or the Collections.sort method to sort the records. You will need to either have the student record class implement the Comparable interface or create a Comparator to sort the student records using Arrays.sort or Collections.sort
For each student record print the students name last, a comma, a space, the students first name; the score should be aligned so that the least significant digit is number the e is score. The grade should be aligned so that the letter is under a
Print the Histogram
Print a blank line, the title, Distribution of Grades on the Midterm Exam and another blank line.
Print a histogram of letter grades. For each letter grade that has at least one score print the letter grade, a colon, a space, and an asterisk for every occurrence of that grade. Remember that some grades are two spaces wide because of the plus or minus and some grades are only one space wide; however, the colons should all align.
Print the Statistics
Print a blank line and then print the average score, standard deviation, and median score to one decimal place.
Computing the median will require that the array be sorted. Use the Merge Sort technique from the previous program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started