Procházet zdrojové kódy

Fixed division by 0 print

Lauren Green před 6 roky
rodič
revize
4b0251ec7e
3 změnil soubory, kde provedl 57 přidání a 35 odebrání
  1. 1
    1
      Console.java
  2. 1
    1
      MainMenu.java
  3. 55
    33
      package.bluej

+ 1
- 1
Console.java Zobrazit soubor

@@ -72,7 +72,7 @@ public class Console {
72 72
                     basicAnswer = Double.NaN;
73 73
                     Console.println("Invalid Input");
74 74
                 }
75
-                if (basicMode.equals("4") && !(basicInput2 == 0)) {
75
+                if (!basicMode.equals("4") && !(basicInput2 == 0)) {
76 76
                 Console.println(Double.toString(basicAnswer));
77 77
             }
78 78
                 break;

+ 1
- 1
MainMenu.java Zobrazit soubor

@@ -22,7 +22,7 @@ public class MainMenu
22 22
     
23 23
     public void mainMenuDisplay()
24 24
     {
25
-        Console.println("Calculator Options:"
25
+        Console.println("\nCalculator Options:"
26 26
                          + "\n1: Basic Calculator (+ - * /)"
27 27
                          + "\n2: Advanced Calculator (Exponential Functions)"
28 28
                          + "\n3: Scientific Functions (Base Conversion, Memory, Trigonometry)"

+ 55
- 33
package.bluej Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 #BlueJ package file
2
-dependency1.from=MainMenu
2
+dependency1.from=Basic
3 3
 dependency1.to=Console
4 4
 dependency1.type=UsesDependency
5 5
 dependency10.from=Console
@@ -20,25 +20,31 @@ dependency14.type=UsesDependency
20 20
 dependency15.from=Console
21 21
 dependency15.to=Trig
22 22
 dependency15.type=UsesDependency
23
+dependency16.from=BasicTest
24
+dependency16.to=Basic
25
+dependency16.type=UsesDependency
26
+dependency17.from=TrigTest
27
+dependency17.to=Trig
28
+dependency17.type=UsesDependency
23 29
 dependency2.from=SciCalc
24 30
 dependency2.to=Console
25 31
 dependency2.type=UsesDependency
26
-dependency3.from=MainApplication
32
+dependency3.from=RealAdvanced
27 33
 dependency3.to=Console
28 34
 dependency3.type=UsesDependency
29 35
 dependency4.from=MemoryFunc
30 36
 dependency4.to=Console
31 37
 dependency4.type=UsesDependency
32
-dependency5.from=SwitchDisplay
38
+dependency5.from=Trig
33 39
 dependency5.to=Console
34 40
 dependency5.type=UsesDependency
35
-dependency6.from=Trig
41
+dependency6.from=SwitchDisplay
36 42
 dependency6.to=Console
37 43
 dependency6.type=UsesDependency
38
-dependency7.from=Basic
44
+dependency7.from=MainMenu
39 45
 dependency7.to=Console
40 46
 dependency7.type=UsesDependency
41
-dependency8.from=RealAdvanced
47
+dependency8.from=MainApplication
42 48
 dependency8.to=Console
43 49
 dependency8.type=UsesDependency
44 50
 dependency9.from=Console
@@ -58,8 +64,8 @@ package.editor.x=35
58 64
 package.editor.y=59
59 65
 package.frame.height=759
60 66
 package.frame.width=619
61
-package.numDependencies=15
62
-package.numTargets=9
67
+package.numDependencies=17
68
+package.numTargets=11
63 69
 package.showExtends=true
64 70
 package.showUses=true
65 71
 project.charset=UTF-8
@@ -68,6 +74,7 @@ readme.name=@README
68 74
 readme.width=47
69 75
 readme.x=10
70 76
 readme.y=10
77
+target1.association=BasicTest
71 78
 target1.height=50
72 79
 target1.name=Basic
73 80
 target1.showInterface=false
@@ -75,6 +82,20 @@ target1.type=ClassTarget
75 82
 target1.width=80
76 83
 target1.x=320
77 84
 target1.y=180
85
+target10.height=50
86
+target10.name=MainMenu
87
+target10.showInterface=false
88
+target10.type=ClassTarget
89
+target10.width=90
90
+target10.x=70
91
+target10.y=10
92
+target11.height=50
93
+target11.name=MainApplication
94
+target11.showInterface=false
95
+target11.type=ClassTarget
96
+target11.width=120
97
+target11.x=70
98
+target11.y=70
78 99
 target2.height=50
79 100
 target2.name=SciCalc
80 101
 target2.showInterface=false
@@ -90,44 +111,45 @@ target3.width=110
90 111
 target3.x=170
91 112
 target3.y=10
92 113
 target4.height=50
93
-target4.name=MemoryFunc
114
+target4.name=TrigTest
94 115
 target4.showInterface=false
95
-target4.type=ClassTarget
96
-target4.width=110
97
-target4.x=210
98
-target4.y=350
116
+target4.type=UnitTestTargetJunit4
117
+target4.width=80
118
+target4.x=350
119
+target4.y=40
99 120
 target5.height=50
100
-target5.name=Console
121
+target5.name=MemoryFunc
101 122
 target5.showInterface=false
102 123
 target5.type=ClassTarget
103
-target5.width=80
104
-target5.x=70
105
-target5.y=170
124
+target5.width=110
125
+target5.x=210
126
+target5.y=350
106 127
 target6.height=50
107
-target6.name=Trig
128
+target6.name=Console
108 129
 target6.showInterface=false
109 130
 target6.type=ClassTarget
110 131
 target6.width=80
111
-target6.x=320
112
-target6.y=70
132
+target6.x=70
133
+target6.y=170
113 134
 target7.height=50
114
-target7.name=SwitchDisplay
135
+target7.name=BasicTest
115 136
 target7.showInterface=false
116
-target7.type=ClassTarget
117
-target7.width=110
118
-target7.x=80
119
-target7.y=350
137
+target7.type=UnitTestTargetJunit4
138
+target7.width=80
139
+target7.x=350
140
+target7.y=150
141
+target8.association=TrigTest
120 142
 target8.height=50
121
-target8.name=MainMenu
143
+target8.name=Trig
122 144
 target8.showInterface=false
123 145
 target8.type=ClassTarget
124
-target8.width=90
125
-target8.x=70
126
-target8.y=10
146
+target8.width=80
147
+target8.x=320
148
+target8.y=70
127 149
 target9.height=50
128
-target9.name=MainApplication
150
+target9.name=SwitchDisplay
129 151
 target9.showInterface=false
130 152
 target9.type=ClassTarget
131
-target9.width=120
132
-target9.x=70
133
-target9.y=70
153
+target9.width=110
154
+target9.x=80
155
+target9.y=350