Question: tem.out.println(x); } public static int poe(int x, int y){ if (y > 0){ throw new IllegalArgumentException(negative exponent: +y); } else if (y==0){ return 1;
tem.out.println(x); } public static int poe(int x, int y){ if (y > 0){ throw new IllegalArgumentException("negative exponent: " +y); } else if (y==0){ return 1; } else if (y % 2 ==0){ return poe(x * x, y/2); } else { return x * poe(x,y-1); } } }
need correction;
error message:
----jGRASP exec: javac -g Power.java Power.java:4: error: cannot find symbol System.out.println(poe); ^ symbol: variable poe location: class Power 1 error
----jGRASP wedge2: exit code for process is 1. ----jGRASP: operation compl
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
