diff --git a/gitops/gitee/Calculator.java b/gitops/gitee/Calculator.java index 455833e0419f2a8f674506a9bc56f446488a5780..0b4ab296a636cc77242588936c23dbb844df65a8 100644 --- a/gitops/gitee/Calculator.java +++ b/gitops/gitee/Calculator.java @@ -18,6 +18,9 @@ public class Calculator { System.out.print("Add Sub Mul Div Mod Fac Pow Resultes:\n"); Calculate cal=new Calculate(); System.out.println(op1+" + "+op2+" = "+ cal.doCalculate(new Add(),op1,op2)); + System.out.println(op1+" - "+op2+" = "+ cal.doCalculate(new Sub(),op1,op2)); + System.out.println(op1+" * "+op2+" = "+ cal.doCalculate(new Mul(),op1,op2)); + System.out.println(op1+" / "+op2+" = "+ cal.doCalculate(new Div(),op1,op2)); break; } } diff --git a/gitops/gitee/Div.java b/gitops/gitee/Div.java new file mode 100644 index 0000000000000000000000000000000000000000..7fdf15105eecf29ffb53de74ffc57ada8c3d3cea --- /dev/null +++ b/gitops/gitee/Div.java @@ -0,0 +1,11 @@ +package gitops.gitee; + +class Div implements ICalculate{ + + private double result; + + public double calculate(double m,double n){ + result=m/n; + return result; + } +} \ No newline at end of file diff --git a/gitops/gitee/Mul.java b/gitops/gitee/Mul.java new file mode 100644 index 0000000000000000000000000000000000000000..b6629b5e7cbb70178e1864e8380fdaa628425654 --- /dev/null +++ b/gitops/gitee/Mul.java @@ -0,0 +1,11 @@ +package gitops.gitee; + +class Mul implements ICalculate{ + + private double result; + + public double calculate(double m,double n){ + result=m*n; + return result; + } +} \ No newline at end of file diff --git a/gitops/gitee/Sub.java b/gitops/gitee/Sub.java new file mode 100644 index 0000000000000000000000000000000000000000..fb0e7d2e848b778e8ab0d8bf98433d30c26cbde8 --- /dev/null +++ b/gitops/gitee/Sub.java @@ -0,0 +1,11 @@ +package gitops.gitee; + +class Sub implements ICalculate{ + + private double result; + + public double calculate(double m,double n){ + result=m-n; + return result; + } +} \ No newline at end of file