Program 6, Finally, a Grade.
Short Description:
Write a program which will act as a grade book.
This assignment is worth 50 points.
Goals
When you finish this homework, you should:
- Developed your program design skills.
- Developed your ability to use files.
- Developed your ability to work with larger functions.
Formal Description
Dr. Gary E. Rader is in trouble. He has carefully graded assignments all semester, dutifully recording grades for each student in that student's file. Now he needs to compute the final grade. When he first started teaching, he learned to use an editor, and that is the only software tool he has ever mastered. In the past he has asked his friend Dr. Cody Good to compute his grades for him but Dr. Good retired and Dr. Rader does not have the programs Dr. Good used. Since you are in Dr. Rader's class, you have decided to assist him by writing a program which will compute his final grades.
Dr. Rader always gives three homeworks, two programs and two tests, no matter what the class or subject. When he grades, Dr. Rader makes a directory for each class. This directory contains a file called roster.txt in the following format.
- A line single of grading information.
- The weight, as an integer between 0 and 100 for homework for this class.
- a white space.
- The weight, as an integer between 0 and 100 for programs for this class.
- a white space.
- The weight, as an integer between 0 and 100 for tests for this class.
- Each student in the class has a single line
- The student's last name
- a comma and a white space
- The student's first name
- A white space
- The student's ten digit id number
- A white space
- Optional comments.
An example of this file MIGHT be:
20 30 50
jones, chuck 1234567890
Jones, Tommy-Lee 1111111111 This is not Chuck's brother. Hangs out with WS
Smith, Will 0987654321 For some reason, always dressed in black.
Smith, Wesson 9999999999 A real straight shooter
Smith, Anna-Nicole 1010101010
Each student listed in the file roster.txt will have their own data file.
The file will be named FDDDDDDDDDDL.data, where F is the student's first initial, in upper case, L is the student's last initial, also uppercase, and DDDDDDDDDD is the student's id number. So the previous roster.txt file would have associated files named:
B1234567890J.data
T1111111111J.data
W0987654321S.data
W9999999999S.data
A1010101010S.data
The format of each student file is:
- Three integers, between 0 and 100, representing the student's homework scores.
- Two integers, between 0 and 100 representing the student's program scores.
- Two floating point numbers, between 0 and 1 representing the student's test scores.
An example file might be T1111111111J.data, which could contain:
90 80 87 100 99 .86 .79
Your program should process the student by opening the student data file, reading in the information, computing the weighted average, and creating an individualized report file.
Each student should have an individual report file in the following format:
- The first line should contain
- First Name
- A space
- Last Name
- The second line should contain the students id number.
- The third line should contain
- The word "Homework:"
- A space
- The student's three homework scores separated by a space.
- The student's homework average, as a percentage, To one decimal place.
- The fourth line should contain
- The word "Programs:"
- A space
- The student's two program scores, separated by a space
- The student's program average, as a percentage, to one decimal place.
- The last fifth line should contain
- The word "Tests:"
- The test scores, as a percentage, (no decimal places) separated by a space.
- The student's test average, as a percentage, to one decimal place.
- The last line should contain
- The words "Class Average:"
- A space
- The student's overall average, as a percentage, to one decimal place.
The file should be named using the previous file name format, but have an extension of .rpt.
An example of this file, using the data file above might be:
The file would be called T1111111111J.rpt.
Tommy-Lee Jones
1111111111
Homework: 90 80 87 85.7%
Programs: 100 99 99.5%
Tests: 86% 79% 82.5%
Class Average: 88.2%
You will read one roster file, read five different grade files and create five different student record files. This will change based upon the number of names listed in the roster file.
Design
You should design this program, including an program design, before you implement the code. This design should be a submitted on Monday April 30, and should include:
- A high level description of the program.
- A functional decomposition of the problem.
- An algorithm for each function.
- A list of questions associated with the assignment.
Please print this design document and hand it in at the beginning of class on Monday April 30. This design is worth 5 points.
Required Files
A single source code file and a design document.
Submission
Email your final source code file to danbennett360@gmail.com.