Commit e5cb43a0 authored by sebastiao.henrique's avatar sebastiao.henrique

ktjyhgtf

parent 7805f22d
Pipeline #375 canceled with stages
......@@ -6,30 +6,33 @@ public class AssessmentPartOne {
// 01 - A Gentle Start
// Debug this method so it passes the unit test.
// Add comments beside any changes you make
if (num1<num2)
if (num1 >num2) //I changed the < the other way around
{
if (num3>num1)
if (num3 > num1)
{
return num3;
}
else
} else
{
return num1;
}
}
else
}else
{
if (num3>num2)
{
return num3;
}
else
if (num3 > num2)
{
return num2
}
return num3; //A ; was added to remove errors
} else
{
return num2;
}
}
}
public int sumNumbersBetween(int start, int end)
{
......@@ -43,9 +46,30 @@ public class AssessmentPartOne {
// You should comment your code explaining what each part does
int sumOfSquares = 0;
if (start <= -1)
{
return -1;
}
if (end<= -1)
{
return -1;
}
if (end -1 <= start +1)
{
return -1;
}
for (int i = start + 1; i <= end - 1; i++)
{
sumOfSquares = sumOfSquares + i;
}
return sumOfSquares;
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