Subject: Re: 360 Assignment 1

> 
> 1) How can I read the files that downloaded from your homepage? ie, Handout-0.ps or ass-1.ps.....
> The file is too large if I open it in SimpleText.
> I can't open it in ClarisWorks.
> The file comes to a single long line if I open it from BBEdit.
> What can I do?

Download to a file and print the file. Or use netscape on unix/macX
and view with ghostscript.

> 2) In the assignment, number 2, to write a function sales that gives the monthly sales from the store...
> If I type   sales 1  , then the function can gives    34, am I right?

Yup.

> then, where can I get the values 34, 25, 16,.....?

The assignment is a bit artificial, I'm afraid. Therefore, the
sales function (and this is the way it is specified) has all the
sales values "hard-wired". I.e. there is no way to add new sales
values (for different years, say).

So, the sales function is extrermely simple: It's the function
that returns 34 if its argument is =1, 25 if its argument =2,
etc.

   
> Or I input the sales value as a consList FIRST, the the sales function read the values from that list?

I had intended for you to use "pattern matching", which we will cover
in tomorrow's lecture. You can of course use a list instead, if you
want. In that case you might need the !!-operator:

[3,5,6,2,5,1] !! 0   => 3
[3,5,6,2,5,1] !! 1   => 5
[3,5,6,2,5,1] !! 2   => 5
[3,5,6,2,5,1] !! 3   => 2

/CC

-- 
___________________________________________________________________________
Christian Collberg      | Email: c_collberg@cs.auckland.ac.nz
Computer Science Dept   | Fax:   +64-9-373-7453
University of Auckland  | Phone: +64-9-373-7599 x 6137
Private Bag 92019,      | WWW:   http://www.cs.auckland.ac.nz/~collberg/
Auckland, NZ            |
___________________________________________________________________________
"Education is an admirable thing, but it is well to remember from time
to time that nothing that is worth knowing can be taught." - Oscar Wilde
___________________________________________________________________________