This is how i would do it:
Code:
int m = mark;
int d = daysLate;
if(m <= 20)
{
System.out.println("Mark is: " + m);
}
else
{
while(d >= 0 && m > 20)
{
m -= 5;
d--;
}
System.out.println("Mark is: " + m);
}
I think it's a bit easier to understand than using a for loop with two variables inside. Just my opinion though! Hope it helps!