Answered step by step
Verified Expert Solution
Link Copied!

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 1.
Table 1 Letter Grade to Score Mapping.
Grade Grade Points
A score >=93
A- score >=90 && score <93
B+ score >=87 && score <90
B score >=83 && score <87
B- score >=80 && score <83
C+ score >=77 && score <80
C score >=70 && score <77
D+ score >=67 && score <70
D score >=60 && score <67
F score <60
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 0. The S in Score should start in column 20. The G in Grade should start in column 27. The next line should have 7 dashes under Student,5 dashes under Score, and 5 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

Students also viewed these Databases questions