#31 Sum of Numbers completed

Otwarty
jbedolla40 chce scalić 1 commity/ów z jbedolla40/ZCW-SumOfInput-BlueJ:master do master
5 zmienionych plików z 30 dodań i 7 usunięć
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 19
    1
      Main.java
  4. 0
    0
      README.TXT
  5. 6
    6
      package.bluej

BIN
Main.class Wyświetl plik


+ 5
- 0
Main.ctxt Wyświetl plik

@@ -0,0 +1,5 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=args
4
+comment1.target=void\ main(java.lang.String[])
5
+numComments=2

+ 19
- 1
Main.java Wyświetl plik

@@ -1,9 +1,27 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
+import java.util.Scanner;
4 5
 public class Main {
5 6
 
6 7
     public static void main(String[] args){
7
-
8
+        
9
+        Scanner n = new Scanner(System.in);
10
+        
11
+        int one = 1;
12
+        
13
+        //get input
14
+        System.out.println("Enter a number: ");
15
+        int num = n.nextInt();
16
+        
17
+        int count = 0;
18
+        
19
+        for(int i = one; i < num; i++)
20
+        {
21
+            System.out.println("Numbers below yours: " + i);
22
+            count += i;
23
+            
24
+        }
25
+      System.out.println("total " + count);
8 26
     }
9 27
 }

+ 0
- 0
README.TXT Wyświetl plik


+ 6
- 6
package.bluej Wyświetl plik

@@ -1,16 +1,16 @@
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=487
5
+editor.fx.0.y=23
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=347
13
+package.editor.y=23
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0