Smalltalk Exercises 1 GNU Smalltalk 1. Given 3 integers, produce a list consisting of the smallest and largest. 2. Given 3 integers, produce a list of the three in sorted order. gst st> FileStream fileIn: 'exer1.st'! FileStream st> (1 findpair: 2 and: 3) printNl! OrderedCollection (3 2 1 ) OrderedCollection new: 16 "<0x403352f8>" st> ! Object methodsFor: 'algorithms' ! findpair: num2 and: num3 | tempList | tempList := OrderedCollection new. tempList add: num3. tempList add: num2. tempList add: self. ^tempList. !! End the GNU Smalltalk file with !!. Separate your functions with ! Example functions max3: num2 and: num3 " st> FileStream fileIn: 'reverse.st'! st> 4 max3: 2 and:1! -> 4 " self > num2 ifTrue: [ self > num3 ifTrue: [ ^self ] ifFalse: [ ^num3 ] ] ifFalse: [ num2 > num3 ifTrue:[ ^num2 ] ifFalse: [ ^num3 ] ]. ! max3 "st> FileStream fileIn: 'reverse.st'! FileStream st> #(100 20 3) max3! -> 100 " | num2 num3 | num2 := self at: 2. num3 := self at: 3. (self first) > (self at: 2) ifTrue: [ (self first) > (self at: 3) ifTrue: [ ^self first ] ifFalse: [ ^(self copyFrom: 3) first ] ] ifFalse: [ (self at:2) > num3 ifTrue:[ ^num2 ] ifFalse: [ ^num3 ] ]. !!