Revision fcbbc9378d67cd227c0f48298e700812469eef62 (click the page title to view the current version)

Exercise 1 solution using inheritance

abstract Lamp
xor shape
ball
square
diamond
TrafficLightSystem
Lamps
Red : Lamp
[ no diamond ]
Yellow : Lamp
[ no square ]
Green : Lamp
[ ball ]
allBalls ?
[ all l : Lamp | l.shape.ball ]
xor orientation
vertical
horizontal

Back to country specific features