Pārlūkot izejas kodu

Elimintated an extra line of code in factorial

Allison Ziegler 6 gadus atpakaļ
vecāks
revīzija
135fb32d6b
3 mainītis faili ar 37 papildinājumiem un 28 dzēšanām
  1. Binārs
      Factorial.class
  2. 1
    2
      Factorial.java
  3. 36
    26
      package.bluej

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


+ 1
- 2
Factorial.java Parādīt failu

@@ -9,8 +9,7 @@ public class Factorial {
9 9
         BigInteger big = BigInteger.valueOf(1);
10 10
 
11 11
         for (int i = 1; i <= value; i++) {
12
-            BigInteger x = BigInteger.valueOf(i);
13
-            big = big.multiply(x);
12
+            big = big.multiply(BigInteger.valueOf(i));
14 13
         }
15 14
         
16 15
         return big;

+ 36
- 26
package.bluej Parādīt failu

@@ -11,22 +11,25 @@ dependency3.type=UsesDependency
11 11
 dependency4.from=IntegerPrinterTest
12 12
 dependency4.to=IntegerPrinter
13 13
 dependency4.type=UsesDependency
14
+dependency5.from=Main
15
+dependency5.to=ShortCalculator
16
+dependency5.type=UsesDependency
14 17
 editor.fx.0.height=0
15 18
 editor.fx.0.width=0
16 19
 editor.fx.0.x=0
17 20
 editor.fx.0.y=0
18
-objectbench.height=101
19
-objectbench.width=1070
20
-package.divider.horizontal=0.6
21
-package.divider.vertical=0.837593984962406
22
-package.editor.height=550
21
+objectbench.height=100
22
+objectbench.width=637
23
+package.divider.horizontal=0.5996275605214153
24
+package.divider.vertical=0.837386018237082
25
+package.editor.height=544
23 26
 package.editor.width=968
24
-package.editor.x=59
25
-package.editor.y=82
26
-package.frame.height=723
27
+package.editor.x=186
28
+package.editor.y=23
29
+package.frame.height=716
27 30
 package.frame.width=1094
28
-package.numDependencies=4
29
-package.numTargets=10
31
+package.numDependencies=5
32
+package.numTargets=11
30 33
 package.showExtends=true
31 34
 package.showUses=true
32 35
 project.charset=UTF-8
@@ -40,36 +43,43 @@ target1.name=Factorial
40 43
 target1.showInterface=false
41 44
 target1.type=ClassTarget
42 45
 target1.width=80
43
-target1.x=160
44
-target1.y=10
46
+target1.x=420
47
+target1.y=220
45 48
 target10.height=50
46 49
 target10.name=IntegerPrinterTest
47 50
 target10.showInterface=false
48 51
 target10.type=UnitTestTargetJunit4
49 52
 target10.width=140
50
-target10.x=10
51
-target10.y=370
53
+target10.x=30
54
+target10.y=430
55
+target11.height=50
56
+target11.name=Main
57
+target11.showInterface=false
58
+target11.type=ClassTarget
59
+target11.width=80
60
+target11.x=540
61
+target11.y=350
52 62
 target2.height=50
53 63
 target2.name=NormalizeAngle
54 64
 target2.showInterface=false
55 65
 target2.type=ClassTarget
56 66
 target2.width=120
57
-target2.x=70
58
-target2.y=70
67
+target2.x=100
68
+target2.y=60
59 69
 target3.height=50
60 70
 target3.name=IntegerPrinter
61 71
 target3.showInterface=false
62 72
 target3.type=ClassTarget
63 73
 target3.width=110
64
-target3.x=10
65
-target3.y=130
74
+target3.x=140
75
+target3.y=450
66 76
 target4.height=50
67 77
 target4.name=ShortCalculator
68 78
 target4.showInterface=false
69 79
 target4.type=ClassTarget
70 80
 target4.width=120
71
-target4.x=130
72
-target4.y=130
81
+target4.x=430
82
+target4.y=420
73 83
 target5.height=50
74 84
 target5.name=LargestInteger
75 85
 target5.showInterface=false
@@ -82,22 +92,22 @@ target6.name=LargestIntegerTest
82 92
 target6.showInterface=false
83 93
 target6.type=UnitTestTargetJunit4
84 94
 target6.width=140
85
-target6.x=250
86
-target6.y=190
95
+target6.x=30
96
+target6.y=250
87 97
 target7.height=50
88 98
 target7.name=ShortCalculatorTest
89 99
 target7.showInterface=false
90 100
 target7.type=ClassTarget
91 101
 target7.width=150
92
-target7.x=10
93
-target7.y=250
102
+target7.x=590
103
+target7.y=430
94 104
 target8.height=50
95 105
 target8.name=NormalizeAngleTest
96 106
 target8.showInterface=false
97 107
 target8.type=UnitTestTargetJunit4
98 108
 target8.width=150
99
-target8.x=10
100
-target8.y=310
109
+target8.x=30
110
+target8.y=100
101 111
 target9.height=50
102 112
 target9.name=FactorialTest
103 113
 target9.showInterface=false