"Gradebook" | |
75 points | |
Assigned: Mon Jun 30, 2003 | Due: Fri Jul 11, 2003 |
The "new" concepts covered in this program are:
We will also review a couple of the basics from good old CSC 160: basic file I/O and sorting. |
The Gradebook program manages the assignment scores
for a class of students. The program should have the following
basic capabilities:
READ - A Gradebook session starts with reading a scores file specified by the user. The format of this file is given below. CHANGE - When the user elects to change grades, the user is shown all the possible categories and must choose one. Then, the user is shown each student in the class and enters a score for the student on the selected assignment. VIEW - When viewing student scores, the user again must first choose the category to be viewed. Then, student scores on that assignment must be listed in descending order based on their score for that assignment. WRITE - Upon exiting, the user must be given the opportunity to save scores to a new file. You should only ask the user this if he/she has made changes to the scores. Student Scores File FormatThe format of the student scores file is:
The first line of the file defines the number of scores, <num_scores>, and number of students, <num_students>, for this class. The second line holds <num_scores> strings separated by commas. These strings define the names of the assignments for each score, things like "Homework" or "Final Exam". The remainder of the file contains <num_students> lines of scores, one per student. Each line should contain the student's name and then <num_scores> integers defining the scores for that student. Example Session Here's a possible example session (user input in bold/underline and shortcuts are C++ commented with //):
Implementation Your implementation must use pointers, rather than array subscripting throughout your program. Your objects and arrays should also be dynamically allocated wherever possible. Your implementation must use classes in an object-oriented approach. As a hint, I used the following classes in my solution:
Other hints:
|
Your program will be graded on three areas: design, quality, and function. Their description and weighting in your grade is given below. 1. Program Design (20%, 15 points) For most of our programs, your program design will be encapsulated in your class header files. Your classes should be consistent and created with an eye toward reuse by other programs. 2. Program quality (20%, 15 points) Your program should be clean and well-commented. More coming on this later. 3. Program function (60%, 45 points) If your program doesn't compile or link, your grade for this section will automatically be cut in half and then I'll start from there. Please leave a README file in your folder with notes you want me to read. |
I have placed two test files in the Common Area: prog02/scores.txt and prog02/scores2.txt July 7, 2003... Forget about my scores2.txt; it's the same as scores.txt. So, you're only responsible for running your program on scores.txt and at least one example of your own creation. July 8, 2003... In the hints above, I mentioned "gobbling" newline characters. Please note that if you use the stream operator ">>" to read integer data from a file, you may also need to consume the commas between the integers. For example, to read a line containing two comma-separated integers from a file, you'd need something like this:
|