i expanded mine so its more understandable

and added it in a class with main for testing

i think it was 2 points for each of the first 5 ( aka 1a = 2p , or 2a = 4p)

then if its over 5 they get 1 more for each ( aka 6a = 11p , or 9a = 14p)

( a = attendance , p = points )

public class Attendance {
public static void main(String[] args) {
int response = attendance(4);
System.out
.println("some 1 attended four times , witch means his score should be 8. it is "
+ response);
response = attendance(5);
System.out
.println("some 1 attended five times , witch means his score should be 10. it is "
+ response);
response = attendance(6);
System.out
.println("some 1 attended six times , witch means his score should be 11. it is "
+ response);
System.out
.println("this should test all three run troughs of the method ");
}
public static int attendance(int attend) {
int points = 0;
if (attend >= 5) { // checks if the times he attended is 5 or more
points = 10; // if it is he gets the 10 points for each of the 1st 5
// lectures
attend = attend - 5; // then while subtract 5 from the times he
// attended
while (attend > 0) { // and for every time after that he gets 1 more
// point
points = points + 1; // adds the point
attend = attend - 1; // subtracts 1 from the attendant before
// the loop runs again
} // so that he wouldn't get free points
} else {
while (attend > 0) { // if he hasn't attended the first 5 lectures
// then he gains 2 points for each he has
points = points + 2;
attend = attend - 1; // essentially the same as the previous
// over 5 point loop but gives 2 points
// instead
}
}
return points;
}
}