-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.java
34 lines (26 loc) · 1.14 KB
/
test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class test {
public static void main(String[] args) {
int a = 7;
int b = 16;
int c = 20;
AddSub obj = new AddSub();
System.out.format("%d + %d = %d\n", a, b, obj.add(a,b));
System.out.format("%d + %d = %d\n", -a, b, obj.add(-a,b));
System.out.format("%d - %d = %d\n", a, b, obj.subtract(a,b));
System.out.format("%d - %d = %d\n", -a, b, obj.subtract(-a,b));
//Test added by Zach for Part 3
System.out.format("%d - %d = %d\n", -c, b, obj.subtract(-c,b));
// Test Cases added by Bryan Schneider (the partner) for Part 3
int x = 8;
int y = 1;
System.out.format("%d + %d = %d\n", x, y, obj.add(x,y));
System.out.format("%d + %d = %d\n", -x, y, obj.add(-x,y));
System.out.format("%d - %d = %d\n", x, -y, obj.add(x,-y));
System.out.format("%d - %d = %d\n", -x, -y, obj.add(-x,-y));
System.out.format("%d + %d = %d\n", x, y, obj.subtract(x,y));
System.out.format("%d + %d = %d\n", -x, y, obj.subtract(-x,y));
System.out.format("%d - %d = %d\n", x, -y, obj.subtract(x,-y));
System.out.format("%d - %d = %d\n", -x, -y, obj.subtract(-x,-y));
// End of partner's tampering
}
}