Student Originated Software 1997-1998
Fall Quarter

A Software Engineering Course at
The Evergreen State College

ARCHIVE -

Student Originated Software

Object-Oriented Programming (Smalltalk)

Smalltalk Notes for Lecture 3a


| p q |
 p:= Point  x:2 y:3.
 Transcript cr; show: p printString.
 q:= Point r:900 theta:30. q inspect.
 p:= 3@4.

(3@4.5) + (12.7@-3)    15.7@1.5
((22/5)@14) - (2@13)   (12/5)@1
(99@100) / (4@4)    (99/4)@25
(3@4.5)+12   15@16.5
12 asPoint.    12@12

"8.2"   (12@1) /2    6@(1/2)
/ scale
 "Answer a new Point that is the quotient of the receiver and
 scale (which is a Point or Number)."

 ^scale quotientFromPoint: self

quotientFromPoint: aPoint

 ^self class x: (aPoint x/x) y: (aPoint y/y)

-----

"8.3"
101.7@77.1 grid:4@4.   100@76
 a new Point to the nearest rounded grid modules specified by aPoint

43@17 dist:45@103    86.0233

(4@3)r.    5.0
(4@3)theta.    0.643501

1@1 dist:2@2   1.41421
"8.4"
1@1 manhattan: 2@2
manhattan: aPoint
 ""  ^(aPoint x-x  + aPoint y-y)

2@2 manhattan: 1@1
 ^( (aPoint x-x)abs  +  (aPoint y-y)abs)

"8.5"

Smalltalk

Integer

"Chapter 9 -  other kinds of Browsers"

3@4 browse.
 

| ans | [ans := Float pi/2] value

| addBlock |
 addBlock := [ :i |  ^ i+1]
 addBlock value:3
 
 

[ SOS Home Page | Case Study | Year Long Projects | OOP ]


For more information contact
[ Evergreen Home Page | Academic Programs ]


Created by: SoSwEbGrOuP
E-mail: ringert@evergreen.edu