#36 Steffon Williams, Sum of Input Lab

Abierta
Stwillia94 desea fusionar 1 commits de Stwillia94/ZCW-SumOfInput-BlueJ:master en master
Se han modificado 7 ficheros con 109 adiciones y 14 borrados
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 12
    1
      Main.java
  4. BIN
      MainTest.class
  5. 15
    0
      MainTest.ctxt
  6. 53
    0
      MainTest.java
  7. 24
    13
      package.bluej

BIN
Main.class Ver fichero


+ 5
- 0
Main.ctxt Ver fichero

@@ -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

+ 12
- 1
Main.java Ver fichero

@@ -1,9 +1,20 @@
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
-    public static void main(String[] args){
7
+    public static void Main(String[] args){
8
+        Scanner in = new Scanner(System.in);
9
+        System.out.println("Please enter your number here: ");
7 10
 
11
+        int n = in.nextInt(); 
12
+        int sum = 0; 
13
+        for (int i = 1; i <= n; i++){
14
+            sum += i;
15
+
16
+        }
17
+        System.out.println("The sum of numbers between 1 and " + n + " is " + sum);
8 18
     }
9 19
 }
20
+

BIN
MainTest.class Ver fichero


+ 15
- 0
MainTest.ctxt Ver fichero

@@ -0,0 +1,15 @@
1
+#BlueJ class context
2
+comment0.target=MainTest
3
+comment0.text=\n\ The\ test\ class\ MainTest.\n\n\ @author\ \ (your\ name)\n\ @version\ (a\ version\ number\ or\ a\ date)\n
4
+comment1.params=
5
+comment1.target=MainTest()
6
+comment1.text=\n\ Default\ constructor\ for\ test\ class\ MainTest\n
7
+comment2.params=
8
+comment2.target=void\ setUp()
9
+comment2.text=\n\ Sets\ up\ the\ test\ fixture.\n\n\ Called\ before\ every\ test\ case\ method.\n
10
+comment3.params=
11
+comment3.target=void\ tearDown()
12
+comment3.text=\n\ Tears\ down\ the\ test\ fixture.\n\n\ Called\ after\ every\ test\ case\ method.\n
13
+comment4.params=
14
+comment4.target=void\ test1()
15
+numComments=5

+ 53
- 0
MainTest.java Ver fichero

@@ -0,0 +1,53 @@
1
+
2
+
3
+import static org.junit.Assert.*;
4
+import org.junit.After;
5
+import org.junit.Before;
6
+import org.junit.Test;
7
+
8
+/**
9
+ * The test class MainTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class MainTest
15
+{
16
+    private Main main1;
17
+    private Main main2;
18
+
19
+    /**
20
+     * Default constructor for test class MainTest
21
+     */
22
+    public MainTest()
23
+    {
24
+    }
25
+
26
+    /**
27
+     * Sets up the test fixture.
28
+     *
29
+     * Called before every test case method.
30
+     */
31
+    @Before
32
+    public void setUp()
33
+    {
34
+        main1 = new Main();
35
+        main2 = new Main();
36
+    }
37
+
38
+    /**
39
+     * Tears down the test fixture.
40
+     *
41
+     * Called after every test case method.
42
+     */
43
+    @After
44
+    public void tearDown()
45
+    {
46
+    }
47
+
48
+    @Test
49
+    public void test1()
50
+    {
51
+    }
52
+}
53
+

+ 24
- 13
package.bluej Ver fichero

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