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

 

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

Write a RECURSIVE method that returns the value of 'base' to the given power 'pow'. You may NOT use any Math methods and you MUST use recursion. For example, if 'base' is 3 and 'pow' is 4, the result is 81 because 3 to the 4th power is 81. If 'base' is 10 and 'pow' is 2, the result is 100 since 10 to the 2nd power is 100.


recursiveExponent(11, 5) → 161051
recursiveExponent(11, 7) → 19487171
recursiveExponent(10, 2) → 100

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

public int recursiveExponent(int base, int pow) { }

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

Copyright Nick Parlante 2017 - privacy