about | help | code help+videos | done | prefs |
Write a method that returns the "okra number" of a given positive integer. Since the work "okra" has 4 letters in it, the "okra number" is based on the number 4. If the given number is a multiple of 4, just return double the value of the given number. However, if the given number is NOT a multiple of 4, return how much MORE it is than the next lower multiple of 4. For example, 11 is three more than the next lower multiple of 4 (which is 8), so okraNumberAdvanced1(11) returns 3. Note that 0 is considered a multiple of 4. okraNumberAdvanced1(17) → 1 okraNumberAdvanced1(16) → 32 okraNumberAdvanced1(8) → 16 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 270
Copyright Nick Parlante 2017 - privacy