Programming Assignment 3 Academic Essay

CSCI 152 Programming Assignment 3
Spring 2016 Due: Friday 4 March

Emphasis on: loops, input from a text file, formatted output

Write a C++ program for a university registrar to process student grades at the end of every semester. We’ll assume that another program has read the final grade files (organized by course) for all courses and has reordered the data into another file which is in order by student.

For each of an unknown number of students, the file SemGrades.txt is formatted like this:
Line 1, col. 1 – 20 student name string
Line 2, col. 1- 8 student id string (12345678 format)
10 credit hours for first course int
11 letter grade for first course char (upper-case A, B, C, D, F)
Additional courses are in the same format with a blank space between each
credit hours-letter grade sequence. The last credit hours-letter grade sequence is followed by a sentinel value of -1.

The data file SemGrades.txt can be downloaded from the Program Assignments folder in eCollege Doc Sharing.

Sample of the input file format:

Cleese, John
11122333 3C 3C 3D 1B 1F 1B -1
Idle, Eric
22233444 4A 3C 3B 1D 3F -1
Palin, Michael
33344555 3B 3A -1

Output the following information for each student:

1. name and id

2. total credit hours attempted this semester (includes all courses given in the input)

3. total credit hours passed this semester
Courses in which the student received a grade of F do not count toward hours passed.

4. total quality points earned this semester

5. GPA for the semester (print in 9.999 format)
Courses in which the student received a grade of F do count toward the student’s GPA.

6. academic status: PRESIDENT’S LIST, DEAN’S LIST, PROBATION, or blank based on:
• PRESIDENT’S LIST if GPA is 4.0 on at least 12 hours passed
• DEAN’S LIST if GPA is in the range 3.5 – 3.999, inclusive, on at least 12 hours passed
• PROBATION if GPA is less than 2.0 on any number of hours
• blank otherwise

When all students have been processed, print a summary showing:
1. total number of students enrolled for this semester
2. percentage of students receiving honors (on either the PRESIDENT’S LIST or DEAN’S LIST)
3. percentage of students on PROBATION

Formulas for Calculations:

quality pts for one course = (credit hours for this course) * (numeric grade for this course)
where numeric grades are : 4 for A, 3 for B, 2 for C, 1 for D, 0 for F

semester quality pts = sum of course quality pts for all courses attempted (including courses with a grade of F)

hours attempted = sum of credit hours for all courses attempted
hours passed = sum of credit hours for all courses with grades other than F

semester GPA = (semester quality pts) / (hours attempted)

Repeating the sample input file:

Cleese, John
11122333 3C 3C 3D 1B 1F 1B -1
Idle, Eric
22233444 4A 3C 3B 1D 3F -1
Palin, Michael
33344555 3B 3A -1

Sample output for the input shown:

Semester Grade Report

Att Passed Qual Academic
Student Name Student ID Hours Hours Pts GPA Status

Cleese, John 11122333 12 11 21 1.750 Probation
Idle, Eric 22233444 14 11 32 2.286
Palin, Michael 33344555 6 6 21 3.500

SUMMARY STATISTICS
Total # students enrolled: 3
Students with Honors: 0.0%
Students on Probation: 33.3%

Program Requirements:

1. You must read the input data from the file provided. Your output may be written to the
screen or to an output text file.

2. Attempted hours, passed hours, quality points, and GPA should be decimal aligned.

3. Names and academic status should be left-justified.

4. Print a percent sign for the percentage of students with honors and on probation.

5. Be sure to identify all output values as shown. No particular horizontal spacing is required.

Algorithm with input statements shown (only processes one student so far)

getline (inFile, name); // name is a string
inFile >> ID; // ID could be an int or it could be a string
inFile >> creditHrs; // read credit hours for first course
while (creditHrs != -1)
{
inFile >> letterGrade;
// add creditHrs to attempted hours
// if student passed the course
// add creditHrs to hours passed
// calculate quality pts for this course and add to sum of quality pts
inFile >> creditHrs; // read credit hours for next course (or read -1 if no more courses)
}
// calculate GPA
// compare GPA to determine academic status
// write output for this student (or finish writing whatever part of it remains to be written)
// if probation, add 1 to count of students on probation
// if honors, add 1 to count of students with honors

Is this question part of your Assignment?

We can help

Our aim is to help you get A+ grades on your Coursework.

We handle assignments in a multiplicity of subject areas including Admission Essays, General Essays, Case Studies, Coursework, Dissertations, Editing, Research Papers, and Research proposals

Header Button Label: Get Started NowGet Started Header Button Label: View writing samplesView writing samples