-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainClass.java
More file actions
43 lines (33 loc) · 947 Bytes
/
MainClass.java
File metadata and controls
43 lines (33 loc) · 947 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package sampleWorkout;
import java.util.Scanner;
public class MainClass {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ArithmeticOperations ae = new ArithmeticOperations();
ScientificOperations so = new ScientificOperations();
System.out.println("Welcome to calculative world!!!");
int opt;
while(true) {
System.out.println("Would you like to perform: ");
System.out.println("1. Arithmetic operations");
System.out.println("2. Scientific operations");
System.out.println("3. Exit");
System.out.print("Enter your choice: ");
opt = sc.nextInt();
switch(opt) {
case 1:
ae.arithmeticOperations();
break;
case 2:
so.scientificOperations();
break;
case 3:
System.out.println("Exiting...");
sc.close();
return;
default:
System.out.println("Invalid option! Please choose 1, 2 or 3.");
}
}
}
}