Biology -- Lab Grade = 30%, Three term tests = 15 % each, Final Exam = 25%
Theater -- Participation (scene studies) = 40 %, Midterm = 25%, Final Exam = 35%
Computer Science -- There are 6 programming assignments, to
be averaged into one Program Average
(which can be a decimal number). Final grade computed as follows:
* Program Average = 30%, Test 1 = 20%, Test 2 = 20%, 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 ("Biology", "Theater", or "Computer Science"), 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:
Biology -- Lab Grade, three term tests, Final Exam
Theater -- Participation, Midterm, Final Exam
Computer Science -- six Program grades, 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 Squarepants, Spongebob Computer Science 90 82 85 96 100 88 85 91 97 Finklebottom, Joe Biology 85 90 78 85 89 Dipwart, Marvin Theater 85 72 95 van Houten, Milhouse Computer Science 45 80 76 79 54 72 73 81 79
2 Simpson, Homer J. Theater 82 76 74 Cyrus, Miley Biology 74 65 58 62 71
*** 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 Squarepants Spongebob Computer Science Finklebottom Joe Biology Dipwart Marvin Theater van Houten Milhouse Computer Science > i Enter filename: blah Invalid file. No data imported > i Enter filename: test2.txt > s Last First Course Squarepants Spongebob Computer Science Finklebottom Joe Biology Dipwart Marvin Theater van Houten Milhouse Computer Science Simpson Homer J. Theater Cyrus Miley Biology > e Enter filename: outfile1.txt > q Goodbye!
Student Grade Summary --------------------- BIOLOGY CLASS Student Final Final Letter Name Exam Avg Grade ---------------------------------------------------------------------- Joe Finklebottom 89 85.70 B Miley Cyrus 71 67.70 D THEATER CLASS Student Final Final Letter Name Exam Avg Grade ---------------------------------------------------------------------- Marvin Dipwart 95 85.25 B Homer J. Simpson 74 77.70 C COMPSCI CLASS Student Final Final Letter Name Exam Avg Grade ---------------------------------------------------------------------- Spongebob Squarepants 97 91.35 A Milhouse van Houten 79 74.80 C OVERALL GRADE DISTRIBUTION A: 1 B: 2 C: 2 D: 1 F: 0