about | help | code help+videos | done | prefs |
Write a recursive method that returns a string for the sumFunNum of an integer. The sumFunNum of a number is found through a strange little process. If the number is divisible by 3 or 5, we add the word "Sun" to a string and then recursively continue with the one's place removed from the number. Otherwise we add the word "Fun" to a string and then recursively continue with the one's place reduced by one. The original number will be positive, and the recursive process will continue as long as you still have a postivie number. Your solution MUST be recursive. No loops of any kind are allowed!!! sunFunNum(454788) → "SunFunSunFunFunSunFunSunSunFunSun" sunFunNum(2353) → "FunSunSunFunFunSunFunFun" sunFunNum(2134) → "FunSunSunSunFunFun" ...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: 430
Copyright Nick Parlante 2017 - privacy