-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInteractRunner.java
More file actions
24 lines (23 loc) · 843 Bytes
/
Copy pathInteractRunner.java
File metadata and controls
24 lines (23 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
public class InteractRunner {
public static void main(String[] arg) {
Scanner reader = new Scanner(System.in);
try {
Calculator calc = new Calculator();
String exit = "no";
while (!exit.equals("yes")){
System.out.println("Enter first arg : ");
String first = reader.next();
System.out.println("Enter second arg : ");
String second = reader.next();
calc.add(Integer.valueOf(first), Integer.valueOf(second));
System.out.println("Result :" + calc.getResult());
calc.cleanResult();
System.out.println("Exit : yes/no");
exit = reader.next();
}
} finally {
reader.close();
}
}
}