For this assignment, you will develop several classes:
You can test your Fibs class with the PrintFibs.java program that prints the first 49 Fibonacci numbers, F0 through F48. When you run PrintFibs with your class correctly, the output should look like this:
0 0 1 1 2 1 3 2 4 3 5 5 6 8 7 13 8 21 9 34 (a lot more lines deleted for the sake of brevity) 40 102334155 41 165580141 42 267914296 43 433494437 44 701408733 45 1134903170 46 1836311903 47 2971215073 48 4807526976Notice that the last few numbers listed exceed the maximum value of a Java int, so you will need to use the 64-bit long type instead of int. Do not "hard-code" values of Fibonacci numbers into your Fibs class; your class must work for arbitrarily large Fibonacci numbers that fit into the Java long type.
The class DrawFibs should have the following properties:
The Primes class should have the same functionality as the Primes class we discussed in class, but it should work for longs. In particular, it should have a public static boolean method isPrime that returns true if its long parameter is prime, false otherwise.
Primes should have the same functionality, but you should write it to be more efficient than the Primes we saw in class. Testing the last few Fibonacci numbers for primality will take a very long time using trial division between 2 and n-1, so find a better way to test for primality. We have discussed one such way in class.
The DrawPrimeFibs should have the same properties as listed above for DrawFibs in addition to the following:
Late assignments will not be accepted. If you're not done with some part before it's due, turn in what you have for partial credit. Don't cheat.