Question: Q2. Write a recursive method called gotThePower that takes an integer parameter called base and an integer parameter called exp. The method returns an integer

Q2. Write a recursive method called gotThePower that takes an integer parameter called base and an integer parameter called exp. The method returns an integer which is the base raised to the exp. Assume both parameters are >=1 You must write a recursive method. These are examples of calls to got ThePower and the results returned ePower (2, 3): 8 gotThe Power (5,2) 25 Note: You must use recursion or lose marks in the exam! Discuss the solution with your team and then start coding ANSWER public int gotThePower (int base, int exp) f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
