©2005 Felleisen, Proulx, et. al.
// representing museum tickets abstract class AMuseTicket { Date d; int price; }
// museum tickets class MuseAdm extends AMuseTicket { MuseAdm(Date d, int price) { this.d = d; this.price = price; } } // to represent time class ClockTime { int hour; int minute; ClockTime(int hour, int minute) { this.hour = hour; this.minute = minute; } } // omnimax admission class OmniMax extends AMuseTicket { ClockTime t; String title; OmniMax(Date d, int price, ClockTime t, String title) { this.d = d; this.price = price; this.t = t; this.title = title; } } // laser admissions class LaserShow extends AMuseTicket { ClockTime t; String row; int seat; LaserShow(Date d, int price, ClockTime t, String row, int seat) { this.d = d; this.price = price; this.t = t; this.row = row; this.seat = seat; } }
Figure 3: Some classes
1.7 Problem
Draw a diagram for the classes in figure 3.