Computer Science 101b Lab 7:User-Defined Classes
Due: November 10, 2000

Objectives and Overview: This lab provides an introduction to user-defined classes and their use in writing programs.

An Answering Machine

In the CS101b (Majercik) folder you will find an Answering Machine folder. In this folder there are three class files: AnsweringMachine.java, Message.java, and Clock.java. There is also a Java program LeaveAMessage.java that uses these classes to simulate (crudely) a telephone answering machine. The AnsweringMachine class is fully defined. I have provided skeletons for the Message and Clock classes and, in this lab, you will complete these two classes. I have placed four slash marks (////) at each point in the Message.java and Clock.java class files where you need to provide something. In some cases, you need to write a method that I've described. In other cases, you need to write the method body given the header.

Lab 7 Deliverables:

Hand in a hard copy of Message.java and Clock.java and leave a copy of your entire Answering Machine folder in the Drop Box in the CS101b (Majercik) folder.