Lab | Assigned | Lab Due (Start of class) |
||
---|---|---|---|---|
19 | Mar | 4 | Apr |
Preliminaries:
fib3.j | The beginning of a Jasmin program for generating the first 30 Fibonnaci-3 numbers. The program as given produces a count from 1 to 10 |
make | Brings your work up-to-date by compiling modified files, including the jasmin file fib3.j. |
java fib3 | Runs the Fibonnaci-3 program |
cd ~cs431/hw5/Solved followed by the above commands |
Runs my solution for you |
procedure iterative fib3(n: nonnegative integer) { if n = 0 then y := 0 else if n = 1 then y := 1 else { w := 0 x := 1 y := 1 for i := 2 to n-1 { /* Here, y is the ith Fibonacci-3 number */ z := w + x + y w := x x := y y := z /* Here, y is the (i+1)th Fibonacci-3 number */ } } /* Here, y is the nth Fibonacci-3 number */ }
mail -s | 'homework 5b lastname_firstname' | cs431@cec < fib3.j |