Skip to content

Commit 387a00e

Browse files
committed
Funcion para las potencias creada
1 parent c92c414 commit 387a00e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Roadmap/27 - SOLID OCP/java/simonguzman.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ public double function(double num1, double num2) {
4040
}
4141
}
4242

43+
static class Power implements Operation{
44+
@Override
45+
public double function(double num1, double num2) {
46+
return Math.pow(num1, num2);
47+
}
48+
}
49+
4350
static class CalculatorOCP{
4451
public double Calculate(Operation operation, double num1, double num2){
4552
return operation.function(num1, num2);

0 commit comments

Comments
 (0)