©2010 Felleisen, Proulx, et. al.

7  Circular Data; State Change

Portfolio Problems

  1. Design the classes that represent the transit system that consists of several train lines, with stations on each line.

    Every line has a name (usually a color name) and a list of stations it serves. Every station has a name and a list of lines that go through the station.

    1. Make an example of a transit system that looks like the MBTA Green Line, Red Line Blue Line, and Orange Line and include two terminal stops and at least two transit stations for each line.

    2. Design the method isTransfer that determines whether a station is a transfer station between one or more lines.

    3. Design the method sameLine in the class Station that determines whether this station is on the same line as the given station.

    4. Design the method oneChange that determines whether we can travel from this station to the given station making exactly one change at a transfer station.

Pair Programming Assignment

7.1  Problem

Complete problems 7.1 and 7.2 from Lab 7 and turn in the complete solution.

7.2  Problem

Complete problem 7.3 from Lab 7 and turn in the complete solution.

7.3  Problem

In this problem we will emulate a college registrar system.

  1. Start a Java project and define the classes and interfaces that implement the class diagram shown on the next page.

    Notice, that we will need to break the circularity of this class diagram.

Last modified: Tuesday, February 23rd, 2010 8:23:43pm