瀏覽代碼

added option 5 to console

Michelle DiMarino 6 年之前
父節點
當前提交
c4d8b4c8ed
共有 2 個檔案被更改,包括 31 行新增30 行删除
  1. 3
    2
      Console.java
  2. 28
    28
      package.bluej

+ 3
- 2
Console.java 查看文件

@@ -92,14 +92,15 @@ public class Console {
92 92
                     advAnswer = advCalc.exponent(advInput1,advInput2);
93 93
 
94 94
                 }else if (mode.equals("3")){
95
-
96 95
                     advAnswer = advCalc.inverse(advInput1);
97 96
 
98 97
                 }else if (mode.equals("4")){
99 98
                     advAnswer = advCalc.opposite(advInput1);
99
+                }else if (mode.equals("5")){
100
+                    advAnswer = advCalc.absoluteValue(advInput1);
100 101
 
101 102
                 }else {
102
-                    Console.println("Invalid input");
103
+                    break;
103 104
                 }
104 105
 
105 106
                 Console.println(Double.toString(advAnswer));

+ 28
- 28
package.bluej 查看文件

@@ -2,50 +2,50 @@
2 2
 dependency1.from=Basic
3 3
 dependency1.to=Console
4 4
 dependency1.type=UsesDependency
5
-dependency10.from=MemoryFunc
6
-dependency10.to=Console
5
+dependency10.from=Console
6
+dependency10.to=MainMenu
7 7
 dependency10.type=UsesDependency
8
-dependency11.from=Trig
9
-dependency11.to=Console
8
+dependency11.from=Console
9
+dependency11.to=Basic
10 10
 dependency11.type=UsesDependency
11
-dependency12.from=SwitchDisplay
12
-dependency12.to=Console
11
+dependency12.from=Console
12
+dependency12.to=RealAdvanced
13 13
 dependency12.type=UsesDependency
14
-dependency13.from=MainMenu
15
-dependency13.to=Console
14
+dependency13.from=Console
15
+dependency13.to=SciCalc
16 16
 dependency13.type=UsesDependency
17
-dependency14.from=MainApplication
18
-dependency14.to=Console
17
+dependency14.from=Console
18
+dependency14.to=MemoryFunc
19 19
 dependency14.type=UsesDependency
20
-dependency15.from=RealAdvanced
21
-dependency15.to=Console
20
+dependency15.from=Console
21
+dependency15.to=SwitchDisplay
22 22
 dependency15.type=UsesDependency
23
-dependency16.from=RealAdvancedTest
24
-dependency16.to=RealAdvanced
23
+dependency16.from=Console
24
+dependency16.to=Trig
25 25
 dependency16.type=UsesDependency
26 26
 dependency2.from=SciCalc
27 27
 dependency2.to=Console
28 28
 dependency2.type=UsesDependency
29
-dependency3.from=Console
30
-dependency3.to=MainMenu
29
+dependency3.from=MemoryFunc
30
+dependency3.to=Console
31 31
 dependency3.type=UsesDependency
32
-dependency4.from=Console
33
-dependency4.to=Basic
32
+dependency4.from=Trig
33
+dependency4.to=Console
34 34
 dependency4.type=UsesDependency
35
-dependency5.from=Console
36
-dependency5.to=RealAdvanced
35
+dependency5.from=SwitchDisplay
36
+dependency5.to=Console
37 37
 dependency5.type=UsesDependency
38
-dependency6.from=Console
39
-dependency6.to=SciCalc
38
+dependency6.from=MainMenu
39
+dependency6.to=Console
40 40
 dependency6.type=UsesDependency
41
-dependency7.from=Console
42
-dependency7.to=MemoryFunc
41
+dependency7.from=MainApplication
42
+dependency7.to=Console
43 43
 dependency7.type=UsesDependency
44
-dependency8.from=Console
45
-dependency8.to=SwitchDisplay
44
+dependency8.from=RealAdvanced
45
+dependency8.to=Console
46 46
 dependency8.type=UsesDependency
47
-dependency9.from=Console
48
-dependency9.to=Trig
47
+dependency9.from=RealAdvancedTest
48
+dependency9.to=RealAdvanced
49 49
 dependency9.type=UsesDependency
50 50
 editor.fx.0.height=709
51 51
 editor.fx.0.width=1215