# Assignment 2, due Jan. 26

On all assignments, your name must be legible as it appears on your University ID card! Assignments are due at the start of class on the day indicated (usually Friday). Exceptions will be by advance arrangement unless there is what lawyers call "an act of God" (something outside your control). Homework must be turned in on paper, either in class or in the teaching assistant's mailbox. Never push late work under someone's door!

1. A scavanger hunt question: Search the notes for Jan. 22 and find:

a) What company introduced the first commercial virtual memory system, in what decade? (0.2 points)

b) What IBM operating system was the first to successfully use virtual memory, in what decade? (0.2 points)

c) What was the first variant of Unix to fully support support virtual memory, in what decade? (0.2 points)

d) What Microsoft operating system was the first to use virtual memory, in what decade? (0.2 points)

e) What Apple operating system was the first to use virtual memory, in what decade? (0.2 points)

2. Background: Fibonacci numbers are conventionally defined recursively as:

n ≤ 1: fib(n) = n

n > 1: fib(n) = fib(n – 1) + fib(n – 2)

You could just as easily use this iterative algorithm, expressed in C:

```int fib( int n ) {
int i = 0
int j = 1
while (n > 0) {
int k = i + j;
i = j;
j = k;
n = n - 1;
}
return i;
}
```

A Problem Write a little tcsh script that computes the nth Fibonacci number. It can be done recursively or iteratively, so long as the user interface works something like this:

```[HawkID@servX]\$ fib 3
2
```

Depending on how you configure your path, you may need to type ./fib Turn in legible readable code, handwritten or machine printed are acceptable. Don't overcomment, but at bare minimum, you should identify the algorithm you are using (recursive or iterative) and the name of the file your script is supposed to be stored in. (2 points).

If you come away from the above assignment hating the Unix shell as a programming language, welcome to the club.