CPSC 275
Fall 2017
Assignment 5: Grade Book
Due: October 2
Overview
This application will be a grade book, showing student names in a list box, and allowing the user to
select a student and open another window to see (and edit) more information.
Application Design
Your grade book should have Open and Save File As buttons which open/save the file in the format
described below. When a file is loaded, the names of the students should be shown in a list box. When a
student’s name is selected in the list box, that student’s major and average should be shown in labels
below the list box. If the user opens another file, clear the current list of students and add the newly
loaded students. If there’s an error loading the file (the file doesn’t exist, or has an invalid format), the
program should catch any exceptions and display an error message.
When a student’s name is double-clicked, a new form should open as a modal dialog box. That form
should have text boxes with the student’s name, major, average, and e-mail. The name text box should
be disabled so the name cannot be changed. Any changes made in the dialog box should be
remembered (those values should be shown in the labels whenever the student is selected, and if the
user saves the student information, the updated information should be saved for that student).
If the user has edited students and not saved the file, then exits the program, a message box should ask
them if they want to save the file (with the Yes/No/Cancel options). If the user clicks Yes, it should
display the Save File dialog box to allow them to save the file. If the user chooses Cancel or cancels the
Save File dialog, the program should not quit. You should not prompt the user if no edits have been
made since opening or saving the file (if the user double clicks on a student, you can assume that edits
have been made—you don’t need to compare the new values to the old ones).
File Format
Each line in the file contains information about one student. The line contains the student’s ID number,
first name, then the last name, followed by the student’s average, the student’s e-mail, and finally the
student’s major. Each piece of data is separated by a comma. The average will be a number, which may
have a decimal portion. Some of the information in the file will not be needed in this assignment, except
for saving the file in the same format.
Example:
34621707,Michael,Costello,76.60,mostello@my.dom.edu,Sociology
26685714,April,Johnston,97.01,aohnston@my.dom.edu,Computer Science
65307352,Christopher,Collins,98.10,ccollins@my.dom.edu,Computer Science
72556183,Valerie,Mayen,66.78,vmayen@my.dom.edu,Biology
Program Usability
As with all assignments this semester, your program should be very user friendly. It should handle errors
with the file (either not being found or having an incorrect format) without crashing/allowing an uncaught
exception, and should display an error message.
This assignment, however, does not need to work for all inputs for the average in the dialog box, just for
numbers (it is okay if your program crashes or has odd errors if something other than a number is input).
Code Readability
As with all assignments this semester, your code should be easily readable. The code should have a set of
comments at the top, noting your name, the assignment number, and a brief description of the program.
All variables should be named appropriately: given a brief, descriptive name. The only exceptions should
be loop variables which may be named i, j, etc. Lastly, each independent piece of code should have a brief
comment describing it. This means that every method, loop, and if statement should have at least one
comment, describing what it does. Complex sections of code may need additional comments.
Submitting the Assignment
Name your application A5_LastName (A5_John for example). Zip your project and submit it to Canvas (be
sure to include the whole solution folder). Submit a printout of your code (Windows Forms code not
needed).
You should also submit a screen capture of the application running:
- With a student selected and the student’s information shown
- With the same student’s information being edited
- The main screen with that same student selected after the student’s information has been
changed
Purchase answer to see full
attachment