84 CHAPTER5. OBJECTSANDGRAPHICS
- 5-clickhouse.
Youaretowritea programthatallowstheusertodraw a simplehouseusingfive mouse-clicks.The
firsttwo clickswillbetheoppositecornersoftherectangularframeofthehouse.Thethirdclickwill
indicatethecenterofthetopedgeofa rectangulardoor. Thedoorshouldhave a totalwidththatis^15
ofthewidthofthehouseframe.Thesidesofthedoorshouldextendfromthecornersofthetopdown
tothebottomoftheframe.Thefourthclickwillindicatethecenterofa squarewindow. Thewindow
is halfaswideasthedoor. Thelastclickwillindicatethepeakoftheroof.Theedgesoftheroofwill
extendfromthepointat thepeaktothecornersofthetopedgeofthehouseframe.
1
2
(^34)