CS 1711 Recitation Laboratory 7:
The Event class - implementing an interface

Objectives:

Hand-in Requirements (Deliverables):

All projects and laboratories should be submitted electronically through webCT by the due date. Zip up your entire project directory to submit. (Right click on the project folder and follow the SentTo link.) The project source directory should include the following:

Overview:

An event is something that happens. An event has a source (who caused the event to occur), a type (what the event is) and a time of occurrence (when the event happens).

In this laboratory, you will implement and test an Event class. The Event class has three attributes (source, type, and time) that are all of type Comparable. The Event class has accessors for its attributes, as well as a toString method. The toString should return a String containing the three attributes in a readable form using the toString method of each attribute.

The Event class implements the Comparable interface. The comparison decision is made on the basis of the event times. Use the source and then type of the two events to break ties.

Part I: Project setup

Part II: Event implements Comparable

Part III: Calculating the statistics of the events (on your own)