Introduction to Computer Science II by James Tam | Return to the course web page |
The full program will read the information about the contacts from a text file called "contacts" and display this information in a graphical list. The user will have the ability to add a new contact or delete an existing contact. When the user quits the program by closing the window the updated contact list will be saved into another text file called "updatedContacts". (To simplify the marking of assignments make sure that you use these exact file names).
Base grade levels |
|
D- |
Student has invested considerable effort in the assignment but the code won't compile. |
D |
Student has invested considerable effort in the assignment. The program compiles but does not fulfill any of the requirements listed below. |
D+ |
Program is an "empty" GUI. While you do not have to use one of the layout manager classes for this assignment, all the components are laid out neatly but none of the functionality has been implemented e.g., pressing a button does nothing. |
C- |
The window can be closed by pressing the close window control at the top right hand side of the window. |
C |
Program reads the initial information for the list of contacts from a file called "contacts". (Again you must use this file name otherwise your TA will have a hard time figuring out what name that you used slowing down the marking process). The list of contacts will be displayed in the list. Your program will automatically load in the list of contacts from file, there is no need to implement another control (such as a "load" button) to do this. |
C+ |
As the window closes (as per the functionality implemented in the "C-" level assignment) the program will write the current contents of the list to a file which must be called "updatedContacts"). |
|
|
Additional features:Implementing each of the features listed below will result in a grade increase of one letter "step" for each feature implemented for a maximum grade of A+. Except as noted below you are free to implement the features in whatever order that you desire. |
|
1 |
The user can remove contacts from the list by selecting it from the list and pressing the remove button. |
2 |
When the list is empty, the remove button is disabled. You must have implemented feature 1 prior to implementing this feature (so that you can first make the list empty). |
3 |
Text that is entered into the text field will be added to the list as a contact when the add button is pressed. |
4 |
Text that is entered into the text field will be added to the list as a contact when the user hits return when the cursor (focus) is in the text field. |
5 |
The title bar indicates to the user that the list changed - it indicates when a new contact was added or when an existing contact was removed (features 1, 3 & 4 must be implemented prior to implementing this feature). The message in the title bar will remain for a few seconds and then the text in the title bar will revert back to what was originally there. |
6 |
The program won't add "empty" contacts to the list. If the text field doesn't contain any text when the add button is pressed or when the user hits return, then nothing will be added to the list. An error message will be displayed to the user for a few seconds before the original text reappears. Again this feature must be implemented after feature 3 & 4 has already been completed. |
Because there aren't any demos for this assignment, this README must be complete enough so that your TA can understand exactly how to run all parts of your program.
File-based input and output:
1While you are allowed to implement your assignment using either the classes in the newer Swing packages or the older AWT packages officially we will be providing support only for AWT. That means that if are using SWING and get stuck then you may be one your own.