Lauren Green il y a 6 ans
Parent
révision
76341efe89
4 fichiers modifiés avec 100 ajouts et 87 suppressions
  1. 3
    0
      Console.java
  2. 10
    1
      Trig.java
  3. 8
    0
      TrigTest.java
  4. 79
    86
      package.bluej

+ 3
- 0
Console.java Voir le fichier

@@ -254,6 +254,9 @@ public class Console {
254 254
                         trigAnswer = trigMenu.calcArctan(trigInput);
255 255
 
256 256
                     } else if (trigMode.equals("7")) {
257
+                        trigAnswer = trigMenu.calcLog(trigInput);
258
+
259
+                    } else if (trigMode.equals("8")) {
257 260
                         break;
258 261
 
259 262
                     } else {

+ 10
- 1
Trig.java Voir le fichier

@@ -20,7 +20,8 @@ public class Trig
20 20
             + "\n4: arcsin"
21 21
             + "\n5: arccosin"
22 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,6 +62,12 @@ public class Trig
61 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 71
     //Converting from Radians to Degrees
65 72
     public double toDegrees(double answer) 
66 73
     {
@@ -69,5 +76,7 @@ public class Trig
69 76
         return answer;
70 77
 
71 78
     }
79
+    
80
+    
72 81
 }
73 82
 

+ 8
- 0
TrigTest.java Voir le fichier

@@ -88,6 +88,13 @@ public class TrigTest
88 88
         Trig trig1 = new Trig();
89 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,3 +103,4 @@ public class TrigTest
96 103
 
97 104
 
98 105
 
106
+

+ 79
- 86
package.bluej Voir le fichier

@@ -1,31 +1,8 @@
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
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 6
 dependency10.to=Basic
30 7
 dependency10.type=UsesDependency
31 8
 dependency11.from=Console
@@ -43,50 +20,43 @@ dependency14.type=UsesDependency
43 20
 dependency15.from=Console
44 21
 dependency15.to=Trig
45 22
 dependency15.type=UsesDependency
46
-dependency16.from=RealAdvancedTest
47
-dependency16.to=RealAdvanced
23
+dependency16.from=Trig
24
+dependency16.to=Console
48 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 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 37
 dependency3.type=UsesDependency
57
-dependency4.from=Trig
58
-dependency4.to=Console
38
+dependency4.from=RealAdvancedTest
39
+dependency4.to=RealAdvanced
59 40
 dependency4.type=UsesDependency
60
-dependency5.from=Basic
41
+dependency5.from=MainMenu
61 42
 dependency5.to=Console
62 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 45
 dependency6.to=Console
71 46
 dependency6.type=UsesDependency
72
-dependency7.from=MainMenu
73
->>>>>>> 3fa2b863a93d1b5548a82c34b3920f059a52833d
47
+dependency7.from=RealAdvanced
74 48
 dependency7.to=Console
75 49
 dependency7.type=UsesDependency
76
-dependency8.from=Console
77
-dependency8.to=MainMenu
50
+dependency8.from=MemoryFunc
51
+dependency8.to=Console
78 52
 dependency8.type=UsesDependency
79 53
 dependency9.from=Console
80
-<<<<<<< HEAD
81
-dependency9.to=Basic
82
-=======
83 54
 dependency9.to=MainMenu
84
->>>>>>> 3fa2b863a93d1b5548a82c34b3920f059a52833d
85 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 60
 objectbench.height=214
91 61
 objectbench.width=595
92 62
 package.divider.horizontal=0.6
@@ -97,8 +67,8 @@ package.editor.x=35
97 67
 package.editor.y=59
98 68
 package.frame.height=759
99 69
 package.frame.width=619
100
-package.numDependencies=15
101
-package.numTargets=9
70
+package.numDependencies=18
71
+package.numTargets=12
102 72
 package.showExtends=true
103 73
 package.showUses=true
104 74
 project.charset=UTF-8
@@ -107,6 +77,7 @@ readme.name=@README
107 77
 readme.width=47
108 78
 readme.x=10
109 79
 readme.y=10
80
+target1.association=BasicTest
110 81
 target1.height=50
111 82
 target1.name=Basic
112 83
 target1.showInterface=false
@@ -114,59 +85,81 @@ target1.type=ClassTarget
114 85
 target1.width=80
115 86
 target1.x=320
116 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 110
 target2.height=50
118
-target2.name=SciCalc
111
+target2.name=TrigTest
119 112
 target2.showInterface=false
120
-target2.type=ClassTarget
113
+target2.type=UnitTestTargetJunit4
121 114
 target2.width=80
122
-target2.x=10
123
-target2.y=280
115
+target2.x=350
116
+target2.y=40
124 117
 target3.height=50
125
-target3.name=RealAdvanced
118
+target3.name=BasicTest
126 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 124
 target4.height=50
132
-target4.name=MemoryFunc
125
+target4.name=RealAdvancedTest
133 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 131
 target5.height=50
139
-target5.name=Console
132
+target5.name=MainMenu
140 133
 target5.showInterface=false
141 134
 target5.type=ClassTarget
142
-target5.width=80
135
+target5.width=90
143 136
 target5.x=70
144
-target5.y=170
137
+target5.y=10
145 138
 target6.height=50
146
-target6.name=Trig
139
+target6.name=SciCalc
147 140
 target6.showInterface=false
148 141
 target6.type=ClassTarget
149 142
 target6.width=80
150
-target6.x=320
151
-target6.y=70
143
+target6.x=10
144
+target6.y=280
152 145
 target7.height=50
153
-target7.name=SwitchDisplay
146
+target7.name=RealAdvanced
154 147
 target7.showInterface=false
155 148
 target7.type=ClassTarget
156 149
 target7.width=110
157
-target7.x=80
158
-target7.y=350
150
+target7.x=170
151
+target7.y=10
159 152
 target8.height=50
160
-target8.name=MainMenu
153
+target8.name=MemoryFunc
161 154
 target8.showInterface=false
162 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 159
 target9.height=50
167
-target9.name=MainApplication
160
+target9.name=Console
168 161
 target9.showInterface=false
169 162
 target9.type=ClassTarget
170
-target9.width=120
163
+target9.width=80
171 164
 target9.x=70
172
-target9.y=70
165
+target9.y=170