Browse Source

Fixed division by 0 print

Lauren Green 6 years ago
parent
commit
4b0251ec7e
3 changed files with 57 additions and 35 deletions
  1. 1
    1
      Console.java
  2. 1
    1
      MainMenu.java
  3. 55
    33
      package.bluej

+ 1
- 1
Console.java View File

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

+ 1
- 1
MainMenu.java View File

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

+ 55
- 33
package.bluej View File

1
 #BlueJ package file
1
 #BlueJ package file
2
-dependency1.from=MainMenu
2
+dependency1.from=Basic
3
 dependency1.to=Console
3
 dependency1.to=Console
4
 dependency1.type=UsesDependency
4
 dependency1.type=UsesDependency
5
 dependency10.from=Console
5
 dependency10.from=Console
20
 dependency15.from=Console
20
 dependency15.from=Console
21
 dependency15.to=Trig
21
 dependency15.to=Trig
22
 dependency15.type=UsesDependency
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
 dependency2.from=SciCalc
29
 dependency2.from=SciCalc
24
 dependency2.to=Console
30
 dependency2.to=Console
25
 dependency2.type=UsesDependency
31
 dependency2.type=UsesDependency
26
-dependency3.from=MainApplication
32
+dependency3.from=RealAdvanced
27
 dependency3.to=Console
33
 dependency3.to=Console
28
 dependency3.type=UsesDependency
34
 dependency3.type=UsesDependency
29
 dependency4.from=MemoryFunc
35
 dependency4.from=MemoryFunc
30
 dependency4.to=Console
36
 dependency4.to=Console
31
 dependency4.type=UsesDependency
37
 dependency4.type=UsesDependency
32
-dependency5.from=SwitchDisplay
38
+dependency5.from=Trig
33
 dependency5.to=Console
39
 dependency5.to=Console
34
 dependency5.type=UsesDependency
40
 dependency5.type=UsesDependency
35
-dependency6.from=Trig
41
+dependency6.from=SwitchDisplay
36
 dependency6.to=Console
42
 dependency6.to=Console
37
 dependency6.type=UsesDependency
43
 dependency6.type=UsesDependency
38
-dependency7.from=Basic
44
+dependency7.from=MainMenu
39
 dependency7.to=Console
45
 dependency7.to=Console
40
 dependency7.type=UsesDependency
46
 dependency7.type=UsesDependency
41
-dependency8.from=RealAdvanced
47
+dependency8.from=MainApplication
42
 dependency8.to=Console
48
 dependency8.to=Console
43
 dependency8.type=UsesDependency
49
 dependency8.type=UsesDependency
44
 dependency9.from=Console
50
 dependency9.from=Console
58
 package.editor.y=59
64
 package.editor.y=59
59
 package.frame.height=759
65
 package.frame.height=759
60
 package.frame.width=619
66
 package.frame.width=619
61
-package.numDependencies=15
62
-package.numTargets=9
67
+package.numDependencies=17
68
+package.numTargets=11
63
 package.showExtends=true
69
 package.showExtends=true
64
 package.showUses=true
70
 package.showUses=true
65
 project.charset=UTF-8
71
 project.charset=UTF-8
68
 readme.width=47
74
 readme.width=47
69
 readme.x=10
75
 readme.x=10
70
 readme.y=10
76
 readme.y=10
77
+target1.association=BasicTest
71
 target1.height=50
78
 target1.height=50
72
 target1.name=Basic
79
 target1.name=Basic
73
 target1.showInterface=false
80
 target1.showInterface=false
75
 target1.width=80
82
 target1.width=80
76
 target1.x=320
83
 target1.x=320
77
 target1.y=180
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
 target2.height=50
99
 target2.height=50
79
 target2.name=SciCalc
100
 target2.name=SciCalc
80
 target2.showInterface=false
101
 target2.showInterface=false
90
 target3.x=170
111
 target3.x=170
91
 target3.y=10
112
 target3.y=10
92
 target4.height=50
113
 target4.height=50
93
-target4.name=MemoryFunc
114
+target4.name=TrigTest
94
 target4.showInterface=false
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
 target5.height=50
120
 target5.height=50
100
-target5.name=Console
121
+target5.name=MemoryFunc
101
 target5.showInterface=false
122
 target5.showInterface=false
102
 target5.type=ClassTarget
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
 target6.height=50
127
 target6.height=50
107
-target6.name=Trig
128
+target6.name=Console
108
 target6.showInterface=false
129
 target6.showInterface=false
109
 target6.type=ClassTarget
130
 target6.type=ClassTarget
110
 target6.width=80
131
 target6.width=80
111
-target6.x=320
112
-target6.y=70
132
+target6.x=70
133
+target6.y=170
113
 target7.height=50
134
 target7.height=50
114
-target7.name=SwitchDisplay
135
+target7.name=BasicTest
115
 target7.showInterface=false
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
 target8.height=50
142
 target8.height=50
121
-target8.name=MainMenu
143
+target8.name=Trig
122
 target8.showInterface=false
144
 target8.showInterface=false
123
 target8.type=ClassTarget
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
 target9.height=50
149
 target9.height=50
128
-target9.name=MainApplication
150
+target9.name=SwitchDisplay
129
 target9.showInterface=false
151
 target9.showInterface=false
130
 target9.type=ClassTarget
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