#27 Kenneth BC lab

Atvērta
KennethT867 vēlas sapludināt 2 revīzijas no KennethT867/ZCW-BasicComputations-BlueJ:master uz master

Binārs
Factorial.class Parādīt failu


+ 5
- 0
Factorial.ctxt Parādīt failu

@@ -0,0 +1,5 @@
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 Parādīt failu

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

Binārs
FactorialTest.class Parādīt failu


+ 7
- 0
FactorialTest.ctxt Parādīt failu

@@ -0,0 +1,7 @@
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ārs
IntegerPrinter.class Parādīt failu


+ 11
- 0
IntegerPrinter.ctxt Parādīt failu

@@ -0,0 +1,11 @@
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 Parādīt failu

@@ -1,18 +1,19 @@
1
- 
2
-
3 1
 
4 2
 public class IntegerPrinter {
5
-
6 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 9
     public String printIntegerAsOctal(int value){
11
-        return null;
10
+        String convert = Integer.toOctalString(value);
11
+        return convert;
12 12
     }
13 13
 
14 14
     public String printIntegerAsHexadecimal(int value){
15
-        return null;
15
+        String convert = Integer.toHexString(value);
16
+        return convert;
16 17
     }
17 18
 
18 19
     public static void main(String[] args){

Binārs
IntegerPrinterTest.class Parādīt failu


+ 11
- 0
IntegerPrinterTest.ctxt Parādīt failu

@@ -0,0 +1,11 @@
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ārs
LargestInteger.class Parādīt failu


+ 7
- 0
LargestInteger.ctxt Parādīt failu

@@ -0,0 +1,7 @@
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 Parādīt failu

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

Binārs
LargestIntegerTest.class Parādīt failu


+ 9
- 0
LargestIntegerTest.ctxt Parādīt failu

@@ -0,0 +1,9 @@
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ārs
NormalizeAngle.class Parādīt failu


+ 9
- 0
NormalizeAngle.ctxt Parādīt failu

@@ -0,0 +1,9 @@
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 Parādīt failu

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

Binārs
NormalizeAngleTest.class Parādīt failu


+ 9
- 0
NormalizeAngleTest.ctxt Parādīt failu

@@ -0,0 +1,9 @@
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 Parādīt failu


Binārs
ShortCalculator.class Parādīt failu


+ 3
- 0
ShortCalculator.ctxt Parādīt failu

@@ -0,0 +1,3 @@
1
+#BlueJ class context
2
+comment0.target=ShortCalculator
3
+numComments=1

Binārs
ShortCalculatorTest.class Parādīt failu


+ 3
- 0
ShortCalculatorTest.ctxt Parādīt failu

@@ -0,0 +1,3 @@
1
+#BlueJ class context
2
+comment0.target=ShortCalculatorTest
3
+numComments=1

+ 19
- 18
package.bluej Parādīt failu

@@ -2,29 +2,29 @@
2 2
 dependency1.from=LargestIntegerTest
3 3
 dependency1.to=LargestInteger
4 4
 dependency1.type=UsesDependency
5
-dependency2.from=NormalizeAngleTest
6
-dependency2.to=NormalizeAngle
5
+dependency2.from=FactorialTest
6
+dependency2.to=Factorial
7 7
 dependency2.type=UsesDependency
8
-dependency3.from=FactorialTest
9
-dependency3.to=Factorial
8
+dependency3.from=IntegerPrinterTest
9
+dependency3.to=IntegerPrinter
10 10
 dependency3.type=UsesDependency
11
-dependency4.from=IntegerPrinterTest
12
-dependency4.to=IntegerPrinter
11
+dependency4.from=NormalizeAngleTest
12
+dependency4.to=NormalizeAngle
13 13
 dependency4.type=UsesDependency
14 14
 editor.fx.0.height=0
15 15
 editor.fx.0.width=0
16 16
 editor.fx.0.x=0
17 17
 editor.fx.0.y=0
18
-objectbench.height=101
19
-objectbench.width=1070
18
+objectbench.height=97
19
+objectbench.width=724
20 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 28
 package.numDependencies=4
29 29
 package.numTargets=10
30 30
 package.showExtends=true
@@ -46,9 +46,9 @@ target10.height=50
46 46
 target10.name=IntegerPrinterTest
47 47
 target10.showInterface=false
48 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 52
 target2.height=50
53 53
 target2.name=NormalizeAngle
54 54
 target2.showInterface=false
@@ -56,6 +56,7 @@ target2.type=ClassTarget
56 56
 target2.width=120
57 57
 target2.x=70
58 58
 target2.y=70
59
+target3.association=IntegerPrinterTest
59 60
 target3.height=50
60 61
 target3.name=IntegerPrinter
61 62
 target3.showInterface=false