copeg explained my point just fine, but here's more detail:
public String[] computeMarks(int[] marks)
{
final int[] WEIGHTING = { 60, 40, 50, 40,30, 20 };
String[] results = new String[WEIGHTING.length];
for (int i = 0; i < marks.length / 2; i++) {
int exam = marks[i+6];
int cw = marks[i+6];
int weight = WEIGHTING[i];
int formula = ((cw + weight) + (exam * (100 - weight)) / 100);
// GB: my suggestion is to add a print statement here to see what
// 'formua' is before the if statements:
System.out.println( "formula = " + formula );
// GB: I believe your original question is "why don't these
// if statements provide results? knowing what 'formula' is
// with the preceding print statement should give you some
// insight
if (formula >= 40)
{
results[i]="PASS";
} else if ((formula < 39) && (formula > 35)){
results[i]="COMPENSATION PASS";
}else{
results[i]="FAIL";
}
}
}