View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sp00 Final Exam Review: Design an Alarm System

See Final Exam Review - Sp2000


do we need to design ONE alarm that serves as both a fire alarm and a burglar alarm or are we designing an alarm and its two subclasses fire alarm and burglar alarm?

if its one for both i think there should be an alarm parent class and two subclasses, fire and burglar, and there is an alarmSystem class that holds an instance of each. though i must admit i am little confused as to what we are being asked to design

Alex Salazar

That's exactly the issue upon which I gave or removed points when grading this. Which is the better design? Mark Guzdial



Ok, I decided to subclass the alarm. Here is my design:

alarm.html

Susi Rathmann


The format is as follows
Classes
.....
Attributes
.....

Alarm
.....
owner
ID "a unique number so that the company will know the location"
.....

FireAlarm: subclass of Alarm
.....
.....

BurgularAlarm: subclass of Alarm
.....
.....

Owner
.....
email
phoneNumber
.....

Message
.....


Methods
.....
trigger

callOwner: aMessage

call: aMessage

automatedReaction:

send:

Harper Maddox


Link to this Page