Second Lab

SumOfOddIntegers.java

Use the program SumIntLooping.java as a model. Modify it so that given N it outputs the sum,

    1 + 3 + 5 + .. + k
of the first N odd numbers.

Fibonacci.java

Write a program to print out the first N Fibonacci numbers. The Fibonacci numbers is the sequence,

   1, 1, 2, 3, 5, 8, .... , f_i, f_(i+1), f_i + f_(i+1), ...
You will probably need two or maybe three variables. One to store lastFibonacci, one to store currentFibonacci, and one to store nextFibonacci. In the while loop, calculate nextFibonacci and then move values around, for instance, currentFibonacci gets moved to lastFibonacci.