#33 Clement Ojie

开启中
primeranary 请求将 1 次代码提交从 primeranary/ZCW-SumOfInput-BlueJ:master 合并至 master
共有 5 个文件被更改,包括 39 次插入13 次删除
  1. 二进制
      Main.class
  2. 5
    0
      Main.ctxt
  3. 15
    2
      Main.java
  4. 0
    0
      README.TXT
  5. 19
    11
      package.bluej

二进制
Main.class 查看文件


+ 5
- 0
Main.ctxt 查看文件

@@ -0,0 +1,5 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=n
4
+comment1.target=int\ sum(int)
5
+numComments=2

+ 15
- 2
Main.java 查看文件

@@ -1,9 +1,22 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
+import java.util.Scanner;
4 5
 public class Main {
6
+    Scanner number = new Scanner(System.in);
5 7
 
6
-    public static void main(String[] args){
8
+    public int add(int n){
9
+        System.out.println("Type in a number: ");
7 10
 
11
+        n = number.nextInt();
12
+        int sum = 0;
13
+
14
+        for (int x = 1; x <= n; x++){
15
+            sum = sum + x;
16
+        }
17
+
18
+        System.out.println("Sum of: " +  sum);
19
+
20
+        return sum;
8 21
     }
9
-}
22
+}

+ 0
- 0
README.TXT 查看文件


+ 19
- 11
package.bluej 查看文件

@@ -1,20 +1,20 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=0
3
-editor.fx.0.width=0
4
-editor.fx.0.x=0
5
-editor.fx.0.y=0
2
+editor.fx.0.height=722
3
+editor.fx.0.width=800
4
+editor.fx.0.x=221
5
+editor.fx.0.y=31
6 6
 objectbench.height=164
7 7
 objectbench.width=776
8 8
 package.divider.horizontal=0.6
9 9
 package.divider.vertical=0.6845018450184502
10 10
 package.editor.height=364
11 11
 package.editor.width=674
12
-package.editor.x=-816
13
-package.editor.y=445
12
+package.editor.x=4
13
+package.editor.y=100
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0
17
-package.numTargets=1
17
+package.numTargets=2
18 18
 package.showExtends=true
19 19
 package.showUses=true
20 20
 project.charset=UTF-8
@@ -24,9 +24,17 @@ readme.width=47
24 24
 readme.x=10
25 25
 readme.y=10
26 26
 target1.height=50
27
-target1.name=Main
27
+target1.name=MainTest
28 28
 target1.showInterface=false
29
-target1.type=ClassTarget
29
+target1.type=UnitTestTargetJunit4
30 30
 target1.width=80
31
-target1.x=70
32
-target1.y=10
31
+target1.x=100
32
+target1.y=-20
33
+target2.association=MainTest
34
+target2.height=50
35
+target2.name=Main
36
+target2.showInterface=false
37
+target2.type=ClassTarget
38
+target2.width=80
39
+target2.x=70
40
+target2.y=10