Skip to content

Commit ff3f59d

Browse files
committed
added calculator class
1 parent 9953860 commit ff3f59d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
public class Calculator {
2+
public int a;
3+
public int b;
4+
5+
public Calculator(int a,int b){
6+
this.a=a;
7+
this.b=b;
8+
}
9+
public int add(){
10+
return this.a+this.b;
11+
}
12+
public int substract(){
13+
return this.a-this.b;
14+
}
15+
public int multiply(){
16+
return this.a*this.b;
17+
}
18+
public int divide(){
19+
return this.a/this.b;
20+
}
21+
22+
}

0 commit comments

Comments
 (0)