


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



This programming assignment uses many of the ideas presented in sections 3 and 4 of the course notes, so you are advised to read these notes and the following program specification carefully.
The input file for this program is named “GradeData.txt”. A sample input file is given below. The input file begins with four header lines, which are meaningful to a human reader but must be ignored by the program. The fifth line of the file contains academic performance data for one student for their previous terms. Following the fifth line are two other header lines, which must be skipped by the program. All of the remaining lines of data pertain to a particular course that the student has taken for the current term, which has just ended. Each of these lines provides the course index number, the credit hours for the course and the student’s achieved numerical grade.
; CS 1044 Fall 2008 ; Project 2 Test File 0 ; Previous Semesters’ Data ; SSN Qual Cred Hrs Att 123456789 40.2 15. ; Current Semester Data ; Index Hours Grade 11366 3.0 2. 12778 3.0 2. 15566 3.0 3. 13366 3.0 2. 11223 3.0 3.
There may be data for an arbitrary number of courses; i.e., we cannot make any assumptions about the minimum or maximum number of courses the student might have taken.
As your class covers input and output in C++, you should examine the given program and make sure you understand precisely how it manages its input and output.
From the previous term data, the program must calculate the student’s GPA, (Grade Point Average). This will give the student’s GPA prior to the beginning of the current term. The Va Tech registrar’s office has a document online that explains a student’s GPA: http://www.undergradcatalog.registrar.vt.edu/0809/acapolicies/grades.html#Anchor-Grades- 17761
The program must calculate quality credits earned for each course in the current semester and summary data for the current term courses. Specifically, the program must compute the total quality points, total hours attempted, and GPA for the current term courses. Additionally, the program must also calculate updated overall academic data for the student. This involves calculating new values for the overall quality credits, hours attempted and a new GPA, which includes the current semester grades.
In order to produce the most accurate results possible in C++, all the decimal values are stored using variables of type double, not type float.
The output file is named “GPAdata.txt”. An output file, which corresponds to the given input file, is shown below. The first two lines specify the programmer and the assignment, and the third is blank. The fourth line specifies column headers for the previous term data. The fifth line echoes the previous term data values and the computed previous GPA. The
sixth line is blank. The seventh line contains table headings for the current term data and the eighth line separates the table data from the labels.
The table body contains one line of output for each course, displaying the index, credit hours, numerical grade and computed quality credits earned for that course. After the last course table line, another line of dashes is written for separation. Following the separation line, aligned under corresponding columns are the semester summary data. This is followed by a blank line. The last two lines of output contain labels and the overall academic updated data.
When a decimal number is written, the number of digits displayed after the decimal point is called the precision of the displayed value. The quality credits, hours attempted, credit hours and grades must be written with precision 1, and the GPA values with precision 2 (as shown in the output sample).
Programmer: Dwight Barnette CS 1044 Project 2 Fall 2008
SSN GPA Qual Cred Hrs Att 123456789 2.68 40.2 15.
11366 3.0 2.7 8. 12778 3.0 2.3 6. 15566 3.0 3.3 9. 13366 3.0 2.0 6. 11223 3.0 3.0 9.
15.0 2.66 39.
GPA Qual Cred Hrs Att 2.67 80.1 30.
If you have read the description of how the Curator scores your program in the Student Guide, you know that is important that you use the same spelling and capitalization for all the labels shown above. The horizontal spacing does not effect scoring unless you combine things that should be separate or separate things that should be combined.
You'll be expected to observe good programming/documentation standards. All the discussions in class about formatting, structure, and commenting your code should be followed. A copy of Elements of Programming Style is included with the course notes — if you don't have a copy I strongly suggest you read the on-line edition (available from the course web page). Some specifics:
You must include header comments specifying the compiler and operating system used and the date completed. Your header comment must describe what your program does; don't just plagiarize language from this spec. You must include a comment explaining the purpose of every variable or named constant you use in your program. You must use meaningful identifier names that suggest the meaning or purpose of the constant, variable, function, etc. Use named constants instead of variables where appropriate. Precede every major block of your code with a comment explaining its purpose. You don't have to describe how it works unless you do something so sneaky it deserves special recognition. You must use indentation and blank lines to make control structures like loops and if-else statements more readable. The code from Project 1 is a good guide.
Your submission that receives the highest score may be graded for adherence to these requirements, whether it is your last submission or not. If two or more of your submissions are tied for highest, the earliest of those will be graded. Therefore: implement and comment your C++ source code with these requirements in mind from the beginning rather than planning to clean up and add comments later. There are NO exceptions to this policy which will be in effect for all programming assignments in this course.
You will submit this assignment to the Curator System (read the Student Guide), and it will be graded automatically. Instructions for submitting, and a description of how the grading is done, are contained in the Student Guide.
You will be allowed up to six submissions for this assignment. Use them wisely. Test your program thoroughly before submitting it. Make sure that your program produces correct results for every sample input file posted on the course website. If you do not get a perfect score, analyze the problem carefully and test your fix with the input file returned as part of the Curator e-mail message, before submitting again.
Your submitted program will be assigned a score based upon the runtime testing performed by the Curator System. We will not be evaluating your submission of this program for documentation style. However, you should examine the given program as a guide to acceptable documentation, and include similar comments for the statements you add to it.
For a number of the later projects, we will also evaluate your submission for documentation, and for other requirements. It is best to begin preparing for that now.
Each of your program submissions must be pledged to conform to the Honor Code requirements for this course. Specifically, you must include the following pledge statement in the header comment for your program:
// On my honor: // // - I have not discussed the C++ language code in my program with // anyone other than my instructor or the teaching assistants // assigned to this course. // // - I have not used C++ language code obtained from another student, // or any other unauthorized source, either modified or unmodified. // // - If any C++ language code or documentation used in my program // was obtained from another source, such as a text book or course // notes, that has been clearly noted with a proper citation in // the comments of my program. // // - I have not designed this program in such a way as to defeat or // interfere with the normal operation of the Curator System. // //
Failure to include this pledge in a submission is a violation of the Honor Code.