English -- Term Paper = 25%, Midterm = 35%, Final Exam = 40%
History -- Attendance = 10%, Project = 30%, Midterm = 30%, Final Exam = 30%
Math -- There are 5 quizzes, to be averaged into one Quiz Average
(which can be a decimal number). Final grade computed as follows:
* Quiz Average = 20%, Test 1 = 25%, Test 2 = 25%, Final Exam = 30%
Your StudentList class needs to have these public functions available:
*** Student List menu *** I Import students from a file S Show student list (brief) E Export a grade report (to file) M Show this Menu Q Quit ProgramThe import and export options should start by asking for user input of a filename (you may assume it will be 30 chars or less, no spaces), then call the appropriate class function for importing a file or printing the grade report to file, respectively. (If the inport/export fails due to bad file, print a message indicating that the job was not successfully completed).
The "Show student list" option should call the class function that prints the brief student list to screen (names and course info only).
The Show this Menu option should re-display the menu.
Quit should end the menu program. (Until this option is selected,
keep looping back for menu selections).
Input File -- The first line of the input file will contain the number of students listed in the file. This will tell you how many student records are being imported from this file. After the first lines, every set of two lines constitutes a student entry. The first line of a student entry is the name, in the format lastName, firstName. Note that a name could include spaces -- the comma will delineate last name from first name. The second line will contain the subject ("English", "History", or "Math"), followed by a list of grades (all integers), all separated by spaces. There will be no extra spaces at the ends of lines in the file. The order of the grades for each class type is as follows:
English -- Term Paper, Midterm, Final Exam
History -- Attendance, Project, Midterm, Final Exam
Math -- Quiz 1, Quiz 2, Quiz 3, Quiz 4, Quiz 5, Test 1, Test
2, Final Exam
Output File -- The output file that you print should list each
student's name (firstName lastName - no extra
punctuation between), Final Exam grade, final average (printed to 2 decimal
places), and letter grade (based on 10 point scale, i.e. 90-100 A, 80-89
B, etc). Output should be separated by subject, with an appropriate heading
before each section, and each student's information listed on a separate
line, in an organized fashion. (See example below). The order of the
students within any given category should be the same as they appear in
the student list. Data must line up
appropriately in columns when multiple lines are printed in the file.
At the bottom of the output file, print a grade distribution of ALL
students -- how many As, Bs, Cs, etc.
O sOrt student listThe letter 'O' option should cause the student list to be sorted alphabetically by name -- by last name, and if needed by first name (when the last names are the same). Do not change any of the stored data in the student records (i.e. don't change the stored case -- upper/lower case -- of the names in the objects). Just re-order the array in the StudentList object so that it is now alphabetized by name. The sort needs to be true alphabetical (not just the "lexicographical" default for strings).
Sample input files: (can download from links)
4 Duck, Daffy Math 90 86 80 95 100 99 96 93 Dipwart, Marvin English 88 75 90 White, Walter History 95 76 85 91 Crack Corn, Jimmy Math 44 58 23 76 50 59 77 68
2 Kirk, James T. History 40 100 68 88 Kardashian, Kim English 60 72 78
*** Student List menu *** I Import students from a file S Show student list (brief) E Export a grade report (to file) M Show this Menu Q Quit Program > i Enter filename: test1.txt > s Last First Course Duck Daffy Math Dipwart Marvin English White Walter History Crack Corn Jimmy Math > i Enter filename: blah Invalid file. No data imported > i Enter filename: test2.txt > s Last First Course Duck Daffy Math Dipwart Marvin English White Walter History Crack Corn Jimmy Math Kirk James T. History Kardashian Kim English > e Enter filename: outfile1.txt > q Goodbye!
Student Grade Summary --------------------- ENGLISH CLASS Student Final Final Letter Name Exam Avg Grade ---------------------------------------------------------------------- Marvin Dipwart 90 84.25 B Kim Kardashian 78 71.40 C HISTORY CLASS Student Final Final Letter Name Exam Avg Grade ---------------------------------------------------------------------- Walter White 91 85.10 B James T. Kirk 88 80.80 B MATH CLASS Student Final Final Letter Name Exam Avg Grade ---------------------------------------------------------------------- Daffy Duck 93 94.69 A Jimmy Crack Corn 68 64.44 D OVERALL GRADE DISTRIBUTION A: 1 B: 3 C: 1 D: 1 F: 0