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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!