Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions SumOfInput.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Write a description of class SumOfInput here.
*
* @author (your name)
* @version (a version number or a date)
* This class takes an interager value, then adds together all of the
* numbers, starting from one, up until it reaches the entered value.
* @author (Jacob Stagg)
* @version (10-29-21)
*/
public class SumOfInput
{
Expand All @@ -17,10 +17,15 @@ public SumOfInput()
// initialise instance variables
sum = 0;
}

public Integer oneToNumber(Integer numberToSum){

public Integer oneToNumber(Integer numberToSum)
{
sum = 0;
for (int i = 1; i <= numberToSum; i++) {
sum += i;
}
System.out.println(sum);

return sum;
}

}
6 changes: 2 additions & 4 deletions SumOfInputTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
Expand All @@ -8,8 +6,8 @@
/**
* The test class SumOfInputTest.
*
* @author (your name)
* @version (a version number or a date)
* @author (Jacob Stagg)
* @version (10-29-21)
*/
public class SumOfInputTest
{
Expand Down