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

 

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

Let's define a "hyper-power" this way: a to the hyper-power of b means a to the b to the b to the b... a total of b times. For example, 2 to the hyper-power of 3 means ((2^3)^3)^3. 5 to the hyper-power of 4 means (((5^4)^4)^4)^4. Clearly these numbers can get very big very fast, so you will need to return your result as a 'long'. Look at the test data for examples. You may assume as a precondition that none of the results will be greater than the maximum 'long' and that num>=1 and power>=0.


mar5_2020_SLHL_hyperPower(4, 0) → 1
mar5_2020_SLHL_hyperPower(17, 2) → 83521
mar5_2020_SLHL_hyperPower(1, 5) → 1

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

public long mar5_2020_SLHL_hyperPower(int num, int power) { }

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