#27 Kenneth BC lab

Open
KennethT867 wants to merge 2 commits from KennethT867/ZCW-BasicComputations-BlueJ:master into master

BIN
Factorial.class View File


+ 5
- 0
Factorial.ctxt View File

1
+#BlueJ class context
2
+comment0.target=Factorial
3
+comment1.params=value
4
+comment1.target=java.math.BigInteger\ factorialOf(java.lang.Integer)
5
+numComments=2

+ 5
- 1
Factorial.java View File

4
 import java.math.BigInteger;
4
 import java.math.BigInteger;
5
 
5
 
6
 public class Factorial {
6
 public class Factorial {
7
-
7
+    private BigInteger n;
8
     public BigInteger factorialOf(Integer value){
8
     public BigInteger factorialOf(Integer value){
9
+        BigInteger n;
10
+        for (int i = 2; i <= value; i++){
11
+        //n = n * value;
12
+        }
9
         return null;
13
         return null;
10
     }
14
     }
11
 
15
 

BIN
FactorialTest.class View File


+ 7
- 0
FactorialTest.ctxt View File

1
+#BlueJ class context
2
+comment0.target=FactorialTest
3
+comment1.params=
4
+comment1.target=void\ setUp()
5
+comment2.params=
6
+comment2.target=void\ factorialOfTest()
7
+numComments=3

BIN
IntegerPrinter.class View File


+ 11
- 0
IntegerPrinter.ctxt View File

1
+#BlueJ class context
2
+comment0.target=IntegerPrinter
3
+comment1.params=value
4
+comment1.target=java.lang.String\ printIntegerAsBinary(int)
5
+comment2.params=value
6
+comment2.target=java.lang.String\ printIntegerAsOctal(int)
7
+comment3.params=value
8
+comment3.target=java.lang.String\ printIntegerAsHexadecimal(int)
9
+comment4.params=args
10
+comment4.target=void\ main(java.lang.String[])
11
+numComments=5

+ 7
- 6
IntegerPrinter.java View File

1
- 
2
-
3
 
1
 
4
 public class IntegerPrinter {
2
 public class IntegerPrinter {
5
-
6
     public String printIntegerAsBinary(int value){
3
     public String printIntegerAsBinary(int value){
7
-        return null;
4
+        String convert = Integer.toBinaryString(value);
5
+        System.out.println(convert);
6
+        return convert;
8
     }
7
     }
9
 
8
 
10
     public String printIntegerAsOctal(int value){
9
     public String printIntegerAsOctal(int value){
11
-        return null;
10
+        String convert = Integer.toOctalString(value);
11
+        return convert;
12
     }
12
     }
13
 
13
 
14
     public String printIntegerAsHexadecimal(int value){
14
     public String printIntegerAsHexadecimal(int value){
15
-        return null;
15
+        String convert = Integer.toHexString(value);
16
+        return convert;
16
     }
17
     }
17
 
18
 
18
     public static void main(String[] args){
19
     public static void main(String[] args){

BIN
IntegerPrinterTest.class View File


+ 11
- 0
IntegerPrinterTest.ctxt View File

1
+#BlueJ class context
2
+comment0.target=IntegerPrinterTest
3
+comment1.params=
4
+comment1.target=void\ setUp()
5
+comment2.params=
6
+comment2.target=void\ printIntegerAsBinaryTest()
7
+comment3.params=
8
+comment3.target=void\ printIntegerAsHexadecimal()
9
+comment4.params=
10
+comment4.target=void\ printIntegerAsOctalTest()
11
+numComments=5

BIN
LargestInteger.class View File


+ 7
- 0
LargestInteger.ctxt View File

1
+#BlueJ class context
2
+comment0.target=LargestInteger
3
+comment1.params=integers
4
+comment1.target=java.lang.Integer\ findLargestNumberUsingConditional(java.lang.Integer[])
5
+comment2.params=integers
6
+comment2.target=java.lang.Integer\ findLargestNumberUsingMathMax(java.lang.Integer[])
7
+numComments=3

+ 4
- 1
LargestInteger.java View File

6
     public Integer findLargestNumberUsingConditional(Integer[] integers){
6
     public Integer findLargestNumberUsingConditional(Integer[] integers){
7
         return null;
7
         return null;
8
     }
8
     }
9
-
9
+        private int i;
10
     public Integer findLargestNumberUsingMathMax(Integer[] integers){
10
     public Integer findLargestNumberUsingMathMax(Integer[] integers){
11
+        for (i = 0; i > integers.length; i++){
12
+        //return Math.max(i, integers);
13
+        }
11
         return null;
14
         return null;
12
     }
15
     }
13
 }
16
 }

BIN
LargestIntegerTest.class View File


+ 9
- 0
LargestIntegerTest.ctxt View File

1
+#BlueJ class context
2
+comment0.target=LargestIntegerTest
3
+comment1.params=
4
+comment1.target=void\ setUp()
5
+comment2.params=
6
+comment2.target=void\ findLargestNumberUsingConditionalTest()
7
+comment3.params=
8
+comment3.target=void\ findLargestNumberUsingMathMaxTest()
9
+numComments=4

BIN
NormalizeAngle.class View File


+ 9
- 0
NormalizeAngle.ctxt View File

1
+#BlueJ class context
2
+comment0.target=NormalizeAngle
3
+comment1.params=angle
4
+comment1.target=java.lang.Integer\ normalizeValueUsingModulo(java.lang.Integer)
5
+comment2.params=integer
6
+comment2.target=java.lang.Integer\ normalizeValueUsingFloorMod(java.lang.Integer)
7
+comment3.params=args
8
+comment3.target=void\ main(java.lang.String[])
9
+numComments=4

+ 3
- 1
NormalizeAngle.java View File

4
 public class NormalizeAngle {
4
 public class NormalizeAngle {
5
 
5
 
6
     public Integer normalizeValueUsingModulo(Integer angle){
6
     public Integer normalizeValueUsingModulo(Integer angle){
7
-        return 0;
7
+        int normalizedAngle = angle%360;
8
+        return normalizedAngle;
8
     }
9
     }
9
 
10
 
10
     public Integer normalizeValueUsingFloorMod(Integer integer){
11
     public Integer normalizeValueUsingFloorMod(Integer integer){
12
+        //Integer normalizedAngle = Math.floor(integer)%360;
11
         return 0;
13
         return 0;
12
     }
14
     }
13
 
15
 

BIN
NormalizeAngleTest.class View File


+ 9
- 0
NormalizeAngleTest.ctxt View File

1
+#BlueJ class context
2
+comment0.target=NormalizeAngleTest
3
+comment1.params=
4
+comment1.target=void\ setUp()
5
+comment2.params=
6
+comment2.target=void\ normalizeValueUsingModuloTest()
7
+comment3.params=
8
+comment3.target=void\ normalizeValueUsingFloorModTest()
9
+numComments=4

+ 0
- 0
README.TXT View File


BIN
ShortCalculator.class View File


+ 3
- 0
ShortCalculator.ctxt View File

1
+#BlueJ class context
2
+comment0.target=ShortCalculator
3
+numComments=1

BIN
ShortCalculatorTest.class View File


+ 3
- 0
ShortCalculatorTest.ctxt View File

1
+#BlueJ class context
2
+comment0.target=ShortCalculatorTest
3
+numComments=1

+ 19
- 18
package.bluej View File

2
 dependency1.from=LargestIntegerTest
2
 dependency1.from=LargestIntegerTest
3
 dependency1.to=LargestInteger
3
 dependency1.to=LargestInteger
4
 dependency1.type=UsesDependency
4
 dependency1.type=UsesDependency
5
-dependency2.from=NormalizeAngleTest
6
-dependency2.to=NormalizeAngle
5
+dependency2.from=FactorialTest
6
+dependency2.to=Factorial
7
 dependency2.type=UsesDependency
7
 dependency2.type=UsesDependency
8
-dependency3.from=FactorialTest
9
-dependency3.to=Factorial
8
+dependency3.from=IntegerPrinterTest
9
+dependency3.to=IntegerPrinter
10
 dependency3.type=UsesDependency
10
 dependency3.type=UsesDependency
11
-dependency4.from=IntegerPrinterTest
12
-dependency4.to=IntegerPrinter
11
+dependency4.from=NormalizeAngleTest
12
+dependency4.to=NormalizeAngle
13
 dependency4.type=UsesDependency
13
 dependency4.type=UsesDependency
14
 editor.fx.0.height=0
14
 editor.fx.0.height=0
15
 editor.fx.0.width=0
15
 editor.fx.0.width=0
16
 editor.fx.0.x=0
16
 editor.fx.0.x=0
17
 editor.fx.0.y=0
17
 editor.fx.0.y=0
18
-objectbench.height=101
19
-objectbench.width=1070
18
+objectbench.height=97
19
+objectbench.width=724
20
 package.divider.horizontal=0.6
20
 package.divider.horizontal=0.6
21
-package.divider.vertical=0.837593984962406
22
-package.editor.height=550
23
-package.editor.width=968
24
-package.editor.x=59
25
-package.editor.y=82
26
-package.frame.height=723
27
-package.frame.width=1094
21
+package.divider.vertical=0.8367346938775511
22
+package.editor.height=526
23
+package.editor.width=622
24
+package.editor.x=0
25
+package.editor.y=22
26
+package.frame.height=695
27
+package.frame.width=748
28
 package.numDependencies=4
28
 package.numDependencies=4
29
 package.numTargets=10
29
 package.numTargets=10
30
 package.showExtends=true
30
 package.showExtends=true
46
 target10.name=IntegerPrinterTest
46
 target10.name=IntegerPrinterTest
47
 target10.showInterface=false
47
 target10.showInterface=false
48
 target10.type=UnitTestTargetJunit4
48
 target10.type=UnitTestTargetJunit4
49
-target10.width=140
50
-target10.x=10
51
-target10.y=370
49
+target10.width=110
50
+target10.x=40
51
+target10.y=100
52
 target2.height=50
52
 target2.height=50
53
 target2.name=NormalizeAngle
53
 target2.name=NormalizeAngle
54
 target2.showInterface=false
54
 target2.showInterface=false
56
 target2.width=120
56
 target2.width=120
57
 target2.x=70
57
 target2.x=70
58
 target2.y=70
58
 target2.y=70
59
+target3.association=IntegerPrinterTest
59
 target3.height=50
60
 target3.height=50
60
 target3.name=IntegerPrinter
61
 target3.name=IntegerPrinter
61
 target3.showInterface=false
62
 target3.showInterface=false