diff --git a/Power.java b/Power.java new file mode 100644 index 0000000..2af7d2d --- /dev/null +++ b/Power.java @@ -0,0 +1,24 @@ + * + * @author Esraa Ramadan + */ + +public class Power implements ISubscriber { + + + public int Power( String input) + { int base = 2; + + int result=1; + for (int i = 0; i < Integer.parseInt(input); i++) { + result *= base; + } + return result; + } + public void notifySubscriber(String input) { + System.out.println(" 2 POWER YOUR NUMBER IS: " + Power(input)); + + // TODO Auto-generated method stub + + } + +}