Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In the Fibonacci sequence of numbers, each number is the sum of the
- // previous two numbers, starting with 1 and 1. This sequence begins:
- // 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
- // Your task is to create a method fibonacciAverage(int COUNT) that
- // returns the average of COUNT first Fibonacci numbers.
- // Let’s do this in the Java 8 way, and create an IntStream that emits
- // Fibonacci numbers. Then we can solve the problem simply by calling
- // IntStream.average(). You can use Google, StackOverflow etc. as needed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement