Introduction to Computer Science II by James Tam Return to the course web page

CPSC 233: Assignment 6 (Worth 8%)

New concepts to be applied in this assignment

How to implement a graphical user interface with Java1:

  1. Frames
  2. Lists
  3. Classes that handle layout (e.g., GridBagLayout)
  4. Textfields
  5. Labels
  6. Buttons
  7. Listener classes (e.g., ones that implement ActionListener)

Introduction

For this assignment you are to implement a simple GUI (graphical user interface) that allows a person to manage a list of email contacts. 

The user will have the ability to add a new contact or delete an existing contact.  When the user is finished working with his or her contacts list, the program can be shut down by closing the window.

Grading: Working submissions

Basic submission (C+):  

When the program is run it will display the frame which contains the graphical controls (2 labels, 2 buttons, a list and text field) and those controls are laid out roughly the same fashion shown in the picture.  To get full credit for the basic submission the graphical controls do not have to be working (at this point it is just an 'empty' interface).

Extra features

Implementing each of the features listed below will result in a grade increase of one letter 'step' for each feature implemented up to a maximum grade of A+.  Except as noted below you are free to implement the features in whatever order that you desire.

1

The window can be closed by pressing the close window control.

2

The user can remove a contact from the list by selecting the contact and pressing the remove button.

3

Text that is entered into the text field will be added to the end of 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 end of the list as a contact when the cursor (focus) is in the text field and the user hits enter.

5

The title bar of the frame indicates to the user when an existing contact was removed (feature 2 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.  Because you won't have learned how to write a timer, the interface will "lock" during this period of time and will not accept any input from the user.

6

In a fashion similar to the previous feature the title bar of the frame will temporarily display a status message when a new contact is added to the list (feature 3 or 4 must be implemented first).

 

Grades for non-functional assignments

D level assignment

The student has invested considerable work in the assignment2 and the code compiles but it doesn't fulfill any of the above requirements.

D- level assignment

The student has invested considerable work in the assignment2 but it doesn't compile.

 

Other submission requirements

In addition to having fulfill the generic assignment requirements the requirements specific to this assignment include:

  1. Good coding style and documentation:  They will play a role in determining your final grade for this assignment.  Your grade can be reduced by a letter step or more (e.g., 'A' to 'A-' for poor programming style such as employing poor naming conventions for identifiers, insufficient documentation or the use of static variables or methods).  For additional details see the marking guide for coding style.

  2. Include a README file in your submission:  For this assignment your README file must indicate what grade level has been completed (e.g., 'A') and which features have been implemented This will allow your marker to quickly determine what he or she must look for and speed up the marking process.  Also you should include your contact information: your name, university identification number and UNIX login name so that your marker knows whose assignment that he or she is marking.  Omitting the necessary information from this file will result in the loss of a letter 'step' (assuming that the marker can actually figure out who the assignment belongs to, if it cannot be determined who the assignment belongs to then no grade will be given for the assignment, an 'F' will be assigned).

  3. Assignments (source code/'dot-java' files and the README file) must be electronically submitted via email (to me and your TA).  In addition a paper print out of the source code and README must be handed into the assignment drop box (located on the second floor of the Math Sciences building) for the tutorial that you are registered in.  Electronically submitting the assignment allows your marker to run the code in order to quickly determine what features were implemented.  Providing a paper printout makes it easier for your marker to read and flip through your source code.  Omitting the paper version of the source code file will result in the loss of a letter 'step'.  Omitting the electronic version of your assignment will only allow you to receive a maximum grade of 'D-' because it's too time consuming for your marker to check every program with a hand trace.  I suggest that as you complete the various features of the assignment that you immediately submit each version so if you forget to submit the final version you will at least have something that your marker can grade because you won't be allowed to submit anything after the deadline.

  4. As a reminder, you are not allowed to work in groups for this class.   Copying the work of another student will be regarded as academic misconduct (cheating).  For additional details about what is and is not okay for this class please refer to the following link.

 

Relevant Files

You can run the sample byte code file called 'Driver.class' which can be found in Unix in the directory: /home/233/assignments/assignment6

   
1 While 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.  Also you need to know how the code in the AWT package works for the final exam.
2  What does and doesn't constitute a sufficient amount of time and effort?  It's a judgment call on the part of your marker.  More often than not if you put in a reasonable amount of effort into your assignment and for some reason you just couldn't get it to work then you will receive some credit for your work.   An example of when you wouldn't receive credit is when you simply handed someone else's work.  This latter case assumes that you properly cited the other person's work, if you didn't cite your source and tried to claim that it was your own work then it would be an example of academic misconduct (cheating).