Nicholas Satinover 6 anni fa
parent
commit
9356baa71a
4 ha cambiato i file con 32 aggiunte e 14 eliminazioni
  1. BIN
      Main.class
  2. 6
    0
      Main.ctxt
  3. 13
    1
      Main.java
  4. 13
    13
      package.bluej

BIN
Main.class Vedi File


+ 6
- 0
Main.ctxt Vedi File

@@ -0,0 +1,6 @@
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=void\ main(java.lang.String[])
6
+numComments=2

+ 13
- 1
Main.java Vedi File

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

+ 13
- 13
package.bluej Vedi File

@@ -1,18 +1,18 @@
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=1057
3
+editor.fx.0.width=1920
4
+editor.fx.0.x=-306
5
+editor.fx.0.y=-1057
6 6
 objectbench.height=164
7
-objectbench.width=776
8
-package.divider.horizontal=0.6
9
-package.divider.vertical=0.6845018450184502
10
-package.editor.height=364
11
-package.editor.width=674
12
-package.editor.x=-816
13
-package.editor.y=445
14
-package.frame.height=600
15
-package.frame.width=800
7
+objectbench.width=1021
8
+package.divider.horizontal=0.5410526315789473
9
+package.divider.vertical=0.8288288288288288
10
+package.editor.height=821
11
+package.editor.width=1794
12
+package.editor.x=-306
13
+package.editor.y=-1057
14
+package.frame.height=1057
15
+package.frame.width=1920
16 16
 package.numDependencies=0
17 17
 package.numTargets=1
18 18
 package.showExtends=true