For this assignment, you are to complete the development of a Java application program, called GPA_App, that produces as output an end-of-semester grade report that lists each student's name, birthdate, and semester grade point average. An example report, and the small input file that was used in generating it, appear below. It is required that your application make use of the Java "instance class" CSV_String.
Mary.Smith@scranton.edu,20001114,CMPS134 3 A,ENGL101 3 B+,PSYC235 3 C+,MATH114 4 B- Richard.Sharkface@scranton.edu,20020502,MUSIC432 3 C+,ART114 3 A,HIST257 3 A- Chris.Glorkhead@wilkes.edu,19991221,T/RS101 3 B+,MATH221 4 D,CMPS144 4 F,HIST354 3 A- Gourdhead.Godfrey@rpi.edu,19601205,PHIL120 3 B,MATH114 4 A-,CHEM141 3 C+ Helen.Trent@psu.edu,20011126,ACC101 3 D,MATH142 4 C+,CMPS112 3 B-,BIOL101 3 B+ |
Name Date of Birth GPA
--------------------------------------------------
Smith, Mary 14-Nov-2000 3.05
Sharkface, Richard 02-May-2002 3.33
Glorkhead, Chris 21-Dec-1999 1.79
Godfrey, Gourdhead 05-Dec-1960 3.07
Trent, Helen 26-Nov-2001 2.33
|
As you can see from the provided sample data, each student's semester performance is described using a CSV-String (in which the comma character is the separator) of this description:
If a "run argument" (as it is called in jGrasp terminology) is provided to the program, it will interpret that argument as the name of the file from which to read input data. Otherwise, the user will be prompted to enter the name of the input file. Either way, the code provided establishes the necessary connection between a Scanner object and the input file.
As you can see, the report has column headings and the entries in the columns are nicely aligned. The code provided to you includes the printHeading() method, which prints both the headings and the "horizontal line" underneath them. The provided code also includes the printStudent() method, which is to be used to print each student output record. Both of these methods call the System.out.printf() method, which is useful for producing nicely aligned columns of data.
As you can infer from the sample report, students' birthdates are to be displayed in the dd-Mon-yyyy format (including leading zeros where appropriate) and students' names are to be displayed in "last-comma-first" format. Thus, it will be necessary for the program to convert calendar dates from one form to another and to infer names from e-mail addresses.
Left for the student to complete are the following:
The intent is that each of the four incomplete methods should be called within the processStudent() method (although indirectly in the case of monthAbbreviation()).
The sample data file provided to you is very small. To do a decent job of testing your work, you need to apply your program to a more extensive set of data. At a minimum, it should include birthdates covering all 12 months and course grades covering all possibilities, from A through F.
Be aware that you can submit more than one time. Hence, if, after submitting, you improve your program (e.g., by fixing logic errors), you should submit the newer version (but always with the same file name!).
Each course is worth a certain number of credit hours. To compute the number of quality points earned in a given course, you multiply its number of credit hours by the quality points value corresponding to the student's grade in that course. For example, for a 3-credit course in which a student earned a grade of C+, the student would be credited with having earned 3 × 2.33 (i.e., essentially 7) quality points.
To compute a student's GPA, you add up the quality points earned in all courses and the number of credit hours in all courses, and you divide the former by the latter.
As an example, consider Gourdhead Godfrey's record in the sample input shown above. His GPA is the value of this expression:
It is expected that these calculations will occur in the computeGPA() method. However, it should be clear that no expression resembling the one above should be found in that method. Rather, the sums forming the numerator and denominator would be accumulated during iterations of a loop, with each iteration processing the data relevant to a single course.