One way to calculate the power of a number xy is to


One way to calculate the power of a number, x^y, is to successively multiply the number with itself until you end up with the answer. Write a recursive method that takes parameters x and y and correctly computes x^y. Assume that x and y are integers. Assume that y is always 0 or a positive positive integer. You must account for the special case when y is 0. x can be positive, negative or 0. Remember that you need to account specially for the case when x is 0. (HINT: The value that will be changing in the recursion is y. Thus first call is made with y, next recursive call is made with y-1, and so on.) (SECOND HINT: The original method call will have 2 parameters in this case: x & y.)

Request for Solution File

Ask an Expert for Answer!!
Other Subject: One way to calculate the power of a number xy is to
Reference No:- TGS0656644

Expected delivery within 24 Hours