Homework 10
22C:18, Fall 1996
Due Tuesday Nov. 19, 1996 in discussion
Douglas W. Jones
-
Write a program in the extended calculator language (lecture 28, Nov 11)
to generate all fibonacci numbers up to 100. The output should begin
something like the following:
0 1 1 2 3 5 8 13 21
Each number in the series is the sum of the previous two; the series
begins with 0 and 1, and the computation takes two or 3 variables depending
on how you write the program. I suggest writing the code in C or Pascal
before you write it in our thoroughly illegible calculator language.
-
Write all of the macros needed to compile the macro version of our basic
calculator language as defined in Lecture 26. Macros are given for
ENTER, DIGIT and MINUS in the notes, but not for PLUS or PRINT.
-
Write code for the macros needed to compile the macro version of the
SAVE and RECALL operations defined in Lecture 28.
-
Rewrite your solution to problem 1 (the Fibonacci Numbers) as a sequence
of macro calls (all but one of the necessary macros can be found above
or in the notes, so testing your solution is perfectly within reason!)