Browse Source

added log

Lauren Green 6 years ago
parent
commit
76341efe89
4 changed files with 100 additions and 87 deletions
  1. 3
    0
      Console.java
  2. 10
    1
      Trig.java
  3. 8
    0
      TrigTest.java
  4. 79
    86
      package.bluej

+ 3
- 0
Console.java View File

254
                         trigAnswer = trigMenu.calcArctan(trigInput);
254
                         trigAnswer = trigMenu.calcArctan(trigInput);
255
 
255
 
256
                     } else if (trigMode.equals("7")) {
256
                     } else if (trigMode.equals("7")) {
257
+                        trigAnswer = trigMenu.calcLog(trigInput);
258
+
259
+                    } else if (trigMode.equals("8")) {
257
                         break;
260
                         break;
258
 
261
 
259
                     } else {
262
                     } else {

+ 10
- 1
Trig.java View File

20
             + "\n4: arcsin"
20
             + "\n4: arcsin"
21
             + "\n5: arccosin"
21
             + "\n5: arccosin"
22
             + "\n6: arctan"
22
             + "\n6: arctan"
23
-            + "\n7: Cancel - returns to Main Menu");   
23
+            + "\n7: log"
24
+            + "\n8: Cancel - returns to Main Menu");   
24
 
25
 
25
         
26
         
26
     }
27
     }
61
         return answer;
62
         return answer;
62
     }
63
     }
63
 
64
 
65
+    //Log Method
66
+    public double calcLog(double x) {
67
+        answer = Math.log10(x);
68
+        return answer;
69
+    }
70
+    
64
     //Converting from Radians to Degrees
71
     //Converting from Radians to Degrees
65
     public double toDegrees(double answer) 
72
     public double toDegrees(double answer) 
66
     {
73
     {
69
         return answer;
76
         return answer;
70
 
77
 
71
     }
78
     }
79
+    
80
+    
72
 }
81
 }
73
 
82
 

+ 8
- 0
TrigTest.java View File

88
         Trig trig1 = new Trig();
88
         Trig trig1 = new Trig();
89
         assertEquals(1.04719755, trig1.calcArccos(0.5), 0.1);
89
         assertEquals(1.04719755, trig1.calcArccos(0.5), 0.1);
90
     }
90
     }
91
+
92
+    @Test
93
+    public void testLog()
94
+    {
95
+        Trig trig1 = new Trig();
96
+        assertEquals(1, trig1.calcLog(10), 0.1);
97
+    }
91
 }
98
 }
92
 
99
 
93
 
100
 
96
 
103
 
97
 
104
 
98
 
105
 
106
+

+ 79
- 86
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
6
-<<<<<<< HEAD
7
-dependency10.to=RealAdvanced
8
-dependency10.type=UsesDependency
9
-dependency11.from=Console
10
-dependency11.to=SciCalc
11
-dependency11.type=UsesDependency
12
-dependency12.from=Console
13
-dependency12.to=MemoryFunc
14
-dependency12.type=UsesDependency
15
-dependency13.from=Console
16
-dependency13.to=SwitchDisplay
17
-dependency13.type=UsesDependency
18
-dependency14.from=Console
19
-dependency14.to=Trig
20
-dependency14.type=UsesDependency
21
-dependency15.from=SwitchDisplay
22
-dependency15.to=Console
23
-dependency15.type=UsesDependency
24
-dependency2.from=SciCalc
25
-dependency2.to=Console
26
-dependency2.type=UsesDependency
27
-dependency3.from=MainApplication
28
-=======
29
 dependency10.to=Basic
6
 dependency10.to=Basic
30
 dependency10.type=UsesDependency
7
 dependency10.type=UsesDependency
31
 dependency11.from=Console
8
 dependency11.from=Console
43
 dependency15.from=Console
20
 dependency15.from=Console
44
 dependency15.to=Trig
21
 dependency15.to=Trig
45
 dependency15.type=UsesDependency
22
 dependency15.type=UsesDependency
46
-dependency16.from=RealAdvancedTest
47
-dependency16.to=RealAdvanced
23
+dependency16.from=Trig
24
+dependency16.to=Console
48
 dependency16.type=UsesDependency
25
 dependency16.type=UsesDependency
49
-dependency2.from=SciCalc
50
-dependency2.to=Console
26
+dependency17.from=SwitchDisplay
27
+dependency17.to=Console
28
+dependency17.type=UsesDependency
29
+dependency18.from=MainApplication
30
+dependency18.to=Console
31
+dependency18.type=UsesDependency
32
+dependency2.from=TrigTest
33
+dependency2.to=Trig
51
 dependency2.type=UsesDependency
34
 dependency2.type=UsesDependency
52
-dependency3.from=MemoryFunc
53
->>>>>>> 49d5555735b5e26b8076429d9dd1666b4918738c
54
->>>>>>> 3fa2b863a93d1b5548a82c34b3920f059a52833d
55
-dependency3.to=Console
35
+dependency3.from=BasicTest
36
+dependency3.to=Basic
56
 dependency3.type=UsesDependency
37
 dependency3.type=UsesDependency
57
-dependency4.from=Trig
58
-dependency4.to=Console
38
+dependency4.from=RealAdvancedTest
39
+dependency4.to=RealAdvanced
59
 dependency4.type=UsesDependency
40
 dependency4.type=UsesDependency
60
-dependency5.from=Basic
41
+dependency5.from=MainMenu
61
 dependency5.to=Console
42
 dependency5.to=Console
62
 dependency5.type=UsesDependency
43
 dependency5.type=UsesDependency
63
-<<<<<<< HEAD
64
-dependency6.from=RealAdvanced
65
-dependency6.to=Console
66
-dependency6.type=UsesDependency
67
-dependency7.from=MemoryFunc
68
-=======
69
-dependency6.from=SwitchDisplay
44
+dependency6.from=SciCalc
70
 dependency6.to=Console
45
 dependency6.to=Console
71
 dependency6.type=UsesDependency
46
 dependency6.type=UsesDependency
72
-dependency7.from=MainMenu
73
->>>>>>> 3fa2b863a93d1b5548a82c34b3920f059a52833d
47
+dependency7.from=RealAdvanced
74
 dependency7.to=Console
48
 dependency7.to=Console
75
 dependency7.type=UsesDependency
49
 dependency7.type=UsesDependency
76
-dependency8.from=Console
77
-dependency8.to=MainMenu
50
+dependency8.from=MemoryFunc
51
+dependency8.to=Console
78
 dependency8.type=UsesDependency
52
 dependency8.type=UsesDependency
79
 dependency9.from=Console
53
 dependency9.from=Console
80
-<<<<<<< HEAD
81
-dependency9.to=Basic
82
-=======
83
 dependency9.to=MainMenu
54
 dependency9.to=MainMenu
84
->>>>>>> 3fa2b863a93d1b5548a82c34b3920f059a52833d
85
 dependency9.type=UsesDependency
55
 dependency9.type=UsesDependency
86
-editor.fx.0.height=749
87
-editor.fx.0.width=1215
88
-editor.fx.0.x=144
89
-editor.fx.0.y=72
56
+editor.fx.0.height=0
57
+editor.fx.0.width=0
58
+editor.fx.0.x=0
59
+editor.fx.0.y=0
90
 objectbench.height=214
60
 objectbench.height=214
91
 objectbench.width=595
61
 objectbench.width=595
92
 package.divider.horizontal=0.6
62
 package.divider.horizontal=0.6
97
 package.editor.y=59
67
 package.editor.y=59
98
 package.frame.height=759
68
 package.frame.height=759
99
 package.frame.width=619
69
 package.frame.width=619
100
-package.numDependencies=15
101
-package.numTargets=9
70
+package.numDependencies=18
71
+package.numTargets=12
102
 package.showExtends=true
72
 package.showExtends=true
103
 package.showUses=true
73
 package.showUses=true
104
 project.charset=UTF-8
74
 project.charset=UTF-8
107
 readme.width=47
77
 readme.width=47
108
 readme.x=10
78
 readme.x=10
109
 readme.y=10
79
 readme.y=10
80
+target1.association=BasicTest
110
 target1.height=50
81
 target1.height=50
111
 target1.name=Basic
82
 target1.name=Basic
112
 target1.showInterface=false
83
 target1.showInterface=false
114
 target1.width=80
85
 target1.width=80
115
 target1.x=320
86
 target1.x=320
116
 target1.y=180
87
 target1.y=180
88
+target10.association=TrigTest
89
+target10.height=50
90
+target10.name=Trig
91
+target10.showInterface=false
92
+target10.type=ClassTarget
93
+target10.width=80
94
+target10.x=320
95
+target10.y=70
96
+target11.height=50
97
+target11.name=SwitchDisplay
98
+target11.showInterface=false
99
+target11.type=ClassTarget
100
+target11.width=110
101
+target11.x=80
102
+target11.y=350
103
+target12.height=50
104
+target12.name=MainApplication
105
+target12.showInterface=false
106
+target12.type=ClassTarget
107
+target12.width=120
108
+target12.x=70
109
+target12.y=70
117
 target2.height=50
110
 target2.height=50
118
-target2.name=SciCalc
111
+target2.name=TrigTest
119
 target2.showInterface=false
112
 target2.showInterface=false
120
-target2.type=ClassTarget
113
+target2.type=UnitTestTargetJunit4
121
 target2.width=80
114
 target2.width=80
122
-target2.x=10
123
-target2.y=280
115
+target2.x=350
116
+target2.y=40
124
 target3.height=50
117
 target3.height=50
125
-target3.name=RealAdvanced
118
+target3.name=BasicTest
126
 target3.showInterface=false
119
 target3.showInterface=false
127
-target3.type=ClassTarget
128
-target3.width=110
129
-target3.x=170
130
-target3.y=10
120
+target3.type=UnitTestTargetJunit4
121
+target3.width=80
122
+target3.x=350
123
+target3.y=150
131
 target4.height=50
124
 target4.height=50
132
-target4.name=MemoryFunc
125
+target4.name=RealAdvancedTest
133
 target4.showInterface=false
126
 target4.showInterface=false
134
-target4.type=ClassTarget
135
-target4.width=110
136
-target4.x=210
137
-target4.y=350
127
+target4.type=UnitTestTargetJunit4
128
+target4.width=140
129
+target4.x=100
130
+target4.y=230
138
 target5.height=50
131
 target5.height=50
139
-target5.name=Console
132
+target5.name=MainMenu
140
 target5.showInterface=false
133
 target5.showInterface=false
141
 target5.type=ClassTarget
134
 target5.type=ClassTarget
142
-target5.width=80
135
+target5.width=90
143
 target5.x=70
136
 target5.x=70
144
-target5.y=170
137
+target5.y=10
145
 target6.height=50
138
 target6.height=50
146
-target6.name=Trig
139
+target6.name=SciCalc
147
 target6.showInterface=false
140
 target6.showInterface=false
148
 target6.type=ClassTarget
141
 target6.type=ClassTarget
149
 target6.width=80
142
 target6.width=80
150
-target6.x=320
151
-target6.y=70
143
+target6.x=10
144
+target6.y=280
152
 target7.height=50
145
 target7.height=50
153
-target7.name=SwitchDisplay
146
+target7.name=RealAdvanced
154
 target7.showInterface=false
147
 target7.showInterface=false
155
 target7.type=ClassTarget
148
 target7.type=ClassTarget
156
 target7.width=110
149
 target7.width=110
157
-target7.x=80
158
-target7.y=350
150
+target7.x=170
151
+target7.y=10
159
 target8.height=50
152
 target8.height=50
160
-target8.name=MainMenu
153
+target8.name=MemoryFunc
161
 target8.showInterface=false
154
 target8.showInterface=false
162
 target8.type=ClassTarget
155
 target8.type=ClassTarget
163
-target8.width=90
164
-target8.x=70
165
-target8.y=10
156
+target8.width=110
157
+target8.x=210
158
+target8.y=350
166
 target9.height=50
159
 target9.height=50
167
-target9.name=MainApplication
160
+target9.name=Console
168
 target9.showInterface=false
161
 target9.showInterface=false
169
 target9.type=ClassTarget
162
 target9.type=ClassTarget
170
-target9.width=120
163
+target9.width=80
171
 target9.x=70
164
 target9.x=70
172
-target9.y=70
165
+target9.y=170