Commit 0ac77381 authored by james.clarke2's avatar james.clarke2

word

parent 7805f22d
Pipeline #366 failed with stages
......@@ -7,26 +7,26 @@ public class AssessmentPartOne {
// Debug this method so it passes the unit test.
// Add comments beside any changes you make
if (num1<num2)
if (num1<num2) // number one is less than 2
{
if (num3>num1)
if (num3>num2)
{
return num3;
return num3;
}
else
{
return num1;
}
{
return num2;
}
}
else
{
if (num3>num2)
if (num3>num1)
{
return num3;
return num3;
}
else
{
return num2
return num1;
}
}
}
......@@ -42,10 +42,30 @@ public class AssessmentPartOne {
// You should comment your code explaining what each part does
int sumOfSquares = 0;
int sumOfSquares = 0; // Sum of Squares starts at 0
if (( start < 0) || (end < 0)){
return sumOfSquares;
return sumOfSquares = -1;
}
while (start < end - 1) {
start++;
sumOfSquares += start;
}
if (sumOfSquares == 0) {
sumOfSquares = -1;
}
return sumOfSquares;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment