Skip to content

Commit ed6e664

Browse files
Create Math2.java
1 parent 96b1072 commit ed6e664

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.codacy.utils;
2+
3+
public class Math2 {
4+
5+
private int magicNumber;
6+
7+
public Math(int magicNumber) {
8+
this.magicNumber = magicNumber;
9+
}
10+
11+
/**
12+
* Adds 2 numbers, unless there is a magic number on the second argument
13+
*/
14+
public int magicAdd(int x, int y) {
15+
if (y == magicNumber) {
16+
int cenas = 12345;
17+
int maisCenas = 67890;
18+
if (cenas > maisCenas) {
19+
System.out.println("what?");
20+
return x;
21+
} else if (cenas < maisCenas) {
22+
return y;
23+
} else {
24+
return y - x;
25+
}
26+
} else {
27+
System.out.println("hey");
28+
return x + y;
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)