Assignment 4 for CSCI 431
Prior to working this assignment you will need to install Squeak on your PC or install it in your UNCA directory and
read
this Squeak tutorial .
- Part 1: Squeak Programs
-
Program 1:
Write a procedure called sum that has one parameter called
max. When called, the procedure should print the sum of all
numbers between 1 and max.
- Program 2:
Write a procedure called even that has one parameter called
number. When called, the program should print "even" if the
value of number is even, or "odd" if number is odd.
- Program 3:
Write a procedure called repeat that has 2 parameters:
count and text. When called, the procedure should
repeat text count times. Each occurance of
text should appear on a separate line.
- Part 2: The Object Hierarchy
-
List all parents and children of the Array class starting with the top
level class in the Hierarchy. Does Smalltalk support multiple
inheritance?
-
What class does the literal 3.2 belong to? Describe a method
that can be applied to this class.