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

 

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

This method MUST use recursion in a meaningful way to solve the problem! Write a method called "recursiveCats" that returns the total number of "lives" that howManyCats have, based on the idea that each cat has 9-lives. For example, recursiveCats(4) returns 36 because each of the 4 cats has 9-lives making a total of 36 lives. Remember, your solution MUST be recursive. You may assume that howManyCats will be non-negative and will not be so large that it causes a stack-overflow due to the recursion.


recursiveCats(9) → 81
recursiveCats(1) → 9
recursiveCats(0) → 0

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

public int recursiveCats(int howManyCats) { }

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: 330

Copyright Nick Parlante 2017 - privacy