Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 4 - Arwa Tyebkhan
Question from Midterm Review - Fall 2002
WRITE SMALLTALK CODE:
Write workspace code (something I can select and say DoIt in the workspace) to draw the below figure. Don't worry about exact sizes–just draw two rectangles with the text inside. (To remind you, Pens know how to up, down, go:, turn:, and north:. Strings know how to displayAt: a given point.)
pen _ Pen new.
pen color: Color black.
pen go:60; turn:90; go:90; turn:90; go:60; turn:90; go:90.
pen goto: 280@240.
pen go:70; turn:90; go:40; turn:90; go:70; turn:90; go:40.
str _ String new.
str _ 'CS2340'.
str displayAt: 230@210.
Links to this Page