Skip to content

Commit 3bf3e26

Browse files
committed
Worked on switch statement <Incomplete>
1 parent 2f024f1 commit 3bf3e26

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

src/main/java/com/zipcodewilmington/scientificcalculator/CalculatorEngine.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public static void print(String output, Object... args) {
1111
System.out.printf(output, args);
1212
}
1313

14+
15+
16+
1417
public static void println(String output, Object... args) {
1518
print(output + "\n", args);
1619
}

src/main/java/com/zipcodewilmington/scientificcalculator/CalculatorInterface.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,35 @@
66
* Created by leon on 2/9/18.
77
*/
88
public class CalculatorInterface {
9-
public static void main(String[] args) {
109

11-
Integer y = 0;
12-
Integer z = 0;
10+
static Integer y = 0;
11+
static Integer z = 0;
12+
private static String prompt;
13+
14+
15+
public static void main(String[] args) {
1316

1417
Scanner scanObject = new Scanner(System.in);
1518

1619
CalculatorEngine.println("Welcome to the calculator!\nWhat would you like to do?");
1720
System.out.println("1. Basic Functions \n2. Scientific Functions \n3. Something Fun!");
1821

22+
23+
public String menuOption1(String prompt) {
24+
}
25+
switch (prompt) {
26+
case "1":
27+
System.out.println("Here are some Basic Functions. \n+ \nAddition , - \n-Subtraction , / \n-Division , * \n-Multiplication";
28+
break;
29+
case "2":
30+
System.out.println("Here are some Scientific Functions. \nSine() \nCosine()");
31+
break;
32+
case "3":
33+
System.out.println("Something Fun!");
34+
break;
35+
}
36+
37+
1938
System.out.println("Please enter a number");
2039

2140
y = scanObject.nextInt();

0 commit comments

Comments
 (0)