#32 summed up

Open
rjsmall90 wants to merge 2 commits from rjsmall90/ZCW-SumOfInput-BlueJ:master into master
4 changed files with 45 additions and 11 deletions
  1. BIN
      Main.class
  2. 6
    0
      Main.ctxt
  3. 30
    2
      Main.java
  4. 9
    9
      package.bluej

BIN
Main.class View File


+ 6
- 0
Main.ctxt View File

1
+#BlueJ class context
2
+comment0.target=Main
3
+comment0.text=\n\ Created\ by\ iyasuwatts\ on\ 10/17/17.\n
4
+comment1.params=args
5
+comment1.target=int\ main(int[])
6
+numComments=2

+ 30
- 2
Main.java View File

1
+import java.util.Scanner;
2
+
1
 /**
3
 /**
2
  * Created by iyasuwatts on 10/17/17.
4
  * Created by iyasuwatts on 10/17/17.
3
  */
5
  */
4
 public class Main {
6
 public class Main {
5
 
7
 
6
-    public static void main(String[] args){
8
+    //public String [] sort(String[] n){
7
 
9
 
8
-    }
10
+    //}
11
+    //public int addItUp(int n)
12
+    
13
+public int main(int [] args){
14
+    System.out.println("Enter a number: ");
15
+    Scanner input = new Scanner(System.in);
16
+    int number = input.nextInt();
17
+    int sum=0;
18
+    for(int element: args){
19
+        sum+=element;}
20
+    
21
+    System.out.println("Your Total is: "+sum);
22
+    return 0;
9
 }
23
 }
24
+    }
25
+
26
+    /*public int sumOf(int [] number){
27
+        int y = input.nextInt();
28
+        int sum=0;
29
+        //step 2 loop through numbers in array 
30
+        for(int element: number){
31
+            sum+=element;
32
+        }
33
+      
34
+        return sum;
35
+    }*/
36
+
37
+

+ 9
- 9
package.bluej View File

1
 #BlueJ package file
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=395
5
+editor.fx.0.y=30
6
 objectbench.height=164
6
 objectbench.height=164
7
-objectbench.width=776
7
+objectbench.width=461
8
 package.divider.horizontal=0.6
8
 package.divider.horizontal=0.6
9
 package.divider.vertical=0.6845018450184502
9
 package.divider.vertical=0.6845018450184502
10
 package.editor.height=364
10
 package.editor.height=364
11
 package.editor.width=674
11
 package.editor.width=674
12
-package.editor.x=-816
13
-package.editor.y=445
12
+package.editor.x=100
13
+package.editor.y=100
14
 package.frame.height=600
14
 package.frame.height=600
15
 package.frame.width=800
15
 package.frame.width=800
16
 package.numDependencies=0
16
 package.numDependencies=0
28
 target1.showInterface=false
28
 target1.showInterface=false
29
 target1.type=ClassTarget
29
 target1.type=ClassTarget
30
 target1.width=80
30
 target1.width=80
31
-target1.x=70
32
-target1.y=10
31
+target1.x=180
32
+target1.y=130