previous next

Computer Science for Transfers
Lab 5 - Comparators

Overview

In this lab, you will practice writing comparators, removing entries from a map and using Iterators.

You will be completing the implementation of the DoctorsOffice class you started developing last week.

Before starting, be sure your DoctorsOffice class is checked into RCS in your lab 4 subdirectory. Check it out with a lock.

Create a lab 5 subdirectory where you will do the work for this lab. Copy the DoctorsOffice.java file into this directory. Create an RCS directory in your lab 5 directory then check in DoctorsOffice.java.

Now check DoctorsOffice.java back out (in your lab 5 directory) and you're ready to start work for this week.

Ask Dr. Tiger

Pre-Lab Activities

  1. Review your class notes on Collections, Comparators, and Iterators.

Objectives

  1. Gain more experience working the the Collections Framework.
  2. Practice writing Comparators.
  3. Practice working with Iterators

Activities

  1. Implement a Patient name Comparator and the listByName() method
  2. Complete the listByAge() method using a comparator as an anonymous object
  3. Complete the DoctorsOffice implementation - removePatient() and listInactive()

Grading

In-lab participation 3 points
Activity 1 9
Activity 2 9
Activity 3 9
Total 30 points

previous next
Last modified September 21, 2003 by tmh.