Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. // In the Fibonacci sequence of numbers, each number is the sum of the
  2.  
  3. // previous two numbers, starting with 1 and 1. This sequence begins:
  4.  
  5. // 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
  6.  
  7. // Your task is to create a method fibonacciAverage(int COUNT) that
  8.  
  9. // returns the average of COUNT first Fibonacci numbers.
  10.  
  11. // Let’s do this in the Java 8 way, and create an IntStream that emits
  12.  
  13. // Fibonacci numbers. Then we can solve the problem simply by calling
  14.  
  15. // IntStream.average(). You can use Google, StackOverflow etc. as needed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement