I'm assuming you're not allowed to use the Math library or recursion.
If that's the case, use--
static double power(double value, short exponent){
if(exponent >= 0){ // if exponent is greater than or equal to zero...
double result = 1; // set result to one
for(short i = 0; i < exponent; i++){ // doing something exponent times
result = result * value; // result is assigned the number of itself times value
}
return result; // return the result
}else return 0; // exponent was less than 0 - return 0 for simplicity.
}