CS 280 Spring 2008

Assignment 9 – Interfaces

Up to 50 “Assignment points” extra credit (NOT test points)

 

Assigned: 03/19/2008

Due: 03/26/2008 at the start of class

 

Pre-Lab (Do Before Lab):  Bring materials – a USB for a take home copy. Plan out what you need to do.

 

Main Assignment:

You are updating the Assignment 8 program.

1.       Make Week a Comparable class (implements the Comparable interface). Do everything necessary for this (Weeks are to be compared based on total pay earned that week).

2.       Add a method to the Employee class to sort the weeks (based on Week being Comparable – so it will sort by pay earned). Use a general sort method; don’t write your own.

3.       Add a “Sort Weeks” button to your GUI that will sort the employee weeks (using the Employee sort method) and redisplay the weeks in their new sorted order in the jTextArea.

 

Hand in:

 

Miscellaneous:

·         Please set the name of the project to something other than the default name (JavaApplication1, …).  (should already be that way from assignment 8)

·         Put  your name in a jlabel on the GUI form OR on the Title Bar (should already be that way from assignment 8)

o    MAKE SURE YOUR PROGRAM WORKS! (i.e. gets correct results, displays them  correctly).  It must provide all of the requested capabilities AND provide them in the expected way – don’t change my code to make your code work! 

o    You MUST include some comments that explain your program in order to get full credit,  including a javadoc compatible comment for each new method!!