Solved

Complete the Code for the CalcPower Recursive Method Shown Below

Question 57

Multiple Choice

Complete the code for the calcPower recursive method shown below, which is intended to raise the base number passed into the method to the exponent power passed into the method: public static int calcPower(int baseNum, int exponent)
{
Int answer = 0;
If (exponent == 0)
{
_____________________
}
Else
{
Answer = baseNum * calcPower (baseNum, exponent - 1) ;
}
Return answer;
}


A) answer = 0;
B) answer = 1;
C) answer = -1;
D) answer = calcPower(1) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions