From ebfaf5842473b77ae309895059020412410181a9 Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 12:49:44 +0000 Subject: [PATCH 1/9] add gitops/gitee/Sub.java. --- gitops/gitee/Sub.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 gitops/gitee/Sub.java diff --git a/gitops/gitee/Sub.java b/gitops/gitee/Sub.java new file mode 100644 index 0000000..fb0e7d2 --- /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 -- Gitee From c322dfa8c02ed9cad9e20dbf6e2b57cfa47da177 Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 12:51:14 +0000 Subject: [PATCH 2/9] update gitops/gitee/Calculator.java. --- gitops/gitee/Calculator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/gitops/gitee/Calculator.java b/gitops/gitee/Calculator.java index 455833e..ff9c465 100644 --- a/gitops/gitee/Calculator.java +++ b/gitops/gitee/Calculator.java @@ -18,6 +18,7 @@ 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)); break; } } -- Gitee From d5f53469690fcd68c128b2ebb57bb42ba7847d4d Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 12:56:13 +0000 Subject: [PATCH 3/9] add gitops/gitee/Mul.java. --- gitops/gitee/Mul.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 gitops/gitee/Mul.java diff --git a/gitops/gitee/Mul.java b/gitops/gitee/Mul.java new file mode 100644 index 0000000..002b4fa --- /dev/null +++ b/gitops/gitee/Mul.java @@ -0,0 +1,9 @@ +package gitops.gitbash; +class Mul implements ICalculate{ + private double result; + public double calculate(double m,double n){ + result=m*n; + System.out.println(m+"*"+n+"="+result); + return result; + } +} \ No newline at end of file -- Gitee From 82e59b078f253cc174910752f8e4c7e40e81e966 Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 12:57:03 +0000 Subject: [PATCH 4/9] update gitops/gitee/Mul.java. --- gitops/gitee/Mul.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitops/gitee/Mul.java b/gitops/gitee/Mul.java index 002b4fa..7174b18 100644 --- a/gitops/gitee/Mul.java +++ b/gitops/gitee/Mul.java @@ -1,9 +1,11 @@ package gitops.gitbash; + class Mul implements ICalculate{ + private double result; + public double calculate(double m,double n){ result=m*n; - System.out.println(m+"*"+n+"="+result); return result; } } \ No newline at end of file -- Gitee From a401b5dde394fe2d378aa2470ce3b0477cbb67df Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 12:57:51 +0000 Subject: [PATCH 5/9] update gitops/gitee/Calculator.java. --- gitops/gitee/Calculator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/gitops/gitee/Calculator.java b/gitops/gitee/Calculator.java index ff9c465..52f5f77 100644 --- a/gitops/gitee/Calculator.java +++ b/gitops/gitee/Calculator.java @@ -19,6 +19,7 @@ public class Calculator { 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 Sub(),op1,op2)); break; } } -- Gitee From e328f66b8662f893fdb33c7c56d141e8bc2642f7 Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 21:03:38 +0800 Subject: [PATCH 6/9] +Mul --- gitops/gitee/Calculator.java | 2 +- gitops/gitee/Mul.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitops/gitee/Calculator.java b/gitops/gitee/Calculator.java index 52f5f77..b6e79a4 100644 --- a/gitops/gitee/Calculator.java +++ b/gitops/gitee/Calculator.java @@ -19,7 +19,7 @@ public class Calculator { 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 Sub(),op1,op2)); + System.out.println(op1+" * "+op2+" = "+ cal.doCalculate(new Mul(),op1,op2)); break; } } diff --git a/gitops/gitee/Mul.java b/gitops/gitee/Mul.java index 7174b18..b6629b5 100644 --- a/gitops/gitee/Mul.java +++ b/gitops/gitee/Mul.java @@ -1,4 +1,4 @@ -package gitops.gitbash; +package gitops.gitee; class Mul implements ICalculate{ -- Gitee From bfa96febd00735e4191fa374b5ec3a0e5f361442 Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 13:04:06 +0000 Subject: [PATCH 7/9] add gitops/gitee/Div.java. --- gitops/gitee/Div.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gitops/gitee/Div.java diff --git a/gitops/gitee/Div.java b/gitops/gitee/Div.java new file mode 100644 index 0000000..f2b48a1 --- /dev/null +++ b/gitops/gitee/Div.java @@ -0,0 +1,13 @@ +package gitops.gitbash; +class Div implements ICalculate{ + private double result; + public double calculate(double m,double n){ + if(0==n){ + System.out.println("ERROR: / by zero!"); + return 0.0; + } + result=m/n; + System.out.println(m+"/"+n+"="+result); + return result; + } +} \ No newline at end of file -- Gitee From f609150cf54a73fb590c6fb54b2f4fe364a0ea2a Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 13:05:46 +0000 Subject: [PATCH 8/9] +Div --- gitops/gitee/Div.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gitops/gitee/Div.java b/gitops/gitee/Div.java index f2b48a1..7fdf151 100644 --- a/gitops/gitee/Div.java +++ b/gitops/gitee/Div.java @@ -1,13 +1,11 @@ -package gitops.gitbash; +package gitops.gitee; + class Div implements ICalculate{ + private double result; + public double calculate(double m,double n){ - if(0==n){ - System.out.println("ERROR: / by zero!"); - return 0.0; - } result=m/n; - System.out.println(m+"/"+n+"="+result); return result; } } \ No newline at end of file -- Gitee From a72863e8c28173c1e37d1472715e8ac6a1103091 Mon Sep 17 00:00:00 2001 From: czldl Date: Fri, 24 Sep 2021 13:08:28 +0000 Subject: [PATCH 9/9] +Div --- gitops/gitee/Calculator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitops/gitee/Calculator.java b/gitops/gitee/Calculator.java index 52f5f77..0b4ab29 100644 --- a/gitops/gitee/Calculator.java +++ b/gitops/gitee/Calculator.java @@ -19,7 +19,8 @@ public class Calculator { 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 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; } } -- Gitee