Commit bd6475e2 authored by Romain's avatar Romain

Part One

parent 7b0cb082
Pipeline #249 canceled with stages
......@@ -7,7 +7,7 @@ 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)// replace < by >
{
if (num3>num1)
{
......@@ -26,7 +26,7 @@ public class AssessmentPartOne {
}
else
{
return num2;
return num2; // add ";" after num2
}
}
}
......@@ -43,6 +43,16 @@ public class AssessmentPartOne {
// You should comment your code explaining what each part does
int sumOfSquares = 0;
if (start+1<end && start>=0)
{
for(int i=start+1;i<end;i++) // loop i=start+1 because start is not included and i<end because we add the last number before end
{
sumOfSquares=sumOfSquares+i;
}
}else
{
sumOfSquares=-1;
}
return sumOfSquares;
......
......@@ -4,6 +4,7 @@ public class Hub {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
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