@@ -0,0 +1,802 @@
+public class Power %7B%0A%09public double power(double base, int exponent) throws Exception %7B%0A        if(exponent==0)%0A            return 1;%0A        if(base==0)%7B%0A            if(exponent%3E0)%0A                return 0;%0A            if(exponent%3C0)%0A                throw new Exception(%22invalid paregrames%22);%0A        %7D%0A        double result = 1;%0A        int exp = exponent;%0A        if(exponent %3C0)%7B%0A            exponent = 0-exponent;%0A        %7D%0A        while(exponent != 0)%7B%0A            if((exponent&1) == 1)%0A                result *= base;%0A            base *= base;%0A            exponent %3E%3E= 1; //%E5%8F%B3%E7%A7%BB%E4%B8%80%E4%BD%8D%0A        %7D%0A        return exp%3E0? result: 1/result;%0A  %09%7D%0A%09%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09double base=2; %0A%09%09int exponent = 3;%0A%09%09System.out.println(new Power().power(base, exponent));%0A%09%7D%0A%7D%0A

Create Power.java