id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > numberSunflowerAustralia
prev  |  next  |  chance

Sunflowers have seed spirals that have consecutive Fibonacci numbers of seeds. Let's call a flower a "Number Sunflower" type of flower if it also has consecutive Fibonacci numbers of seeds. Fibonacci numbers are of the form: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... where the first two Fibonacci numbers are 1 and 1 and each number after that is the sum of the previous two numbers. For this method, num1 will always be less than num2. Also, num1 and num2 will be positive integers. Return true if num1 and num2 are consecutive Fibonacci numbers. Otherwise return false.


numberSunflowerAustralia(55, 89) → true
numberSunflowerAustralia(89, 111) → false
numberSunflowerAustralia(9227465, 14930352) → true

...Save, Compile, Run (ctrl-enter)

public boolean numberSunflowerAustralia(int num1, int num2) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 290

Copyright Nick Parlante 2017 - privacy