The logical OR operator in actionscript is "||" (OR was deprecated the last time I programmed in AS)
and your logic was a little wonky it needs to be a logical AND
so the logic would read "if (greater than OR equal to 66) AND (less than 80) then" otherwise everything more than 66 would match the "greater than 66" comparison.
reworked and tidied code.
Code:
if (percent<66) {
greeting1 ="Bad Luck.";
greeting2 ="You failed. You need 66% to pass.";
} else if ((percent>=66) && (percent<80)){
greeting1 = "Good Try!";
greeting2 = "You passed!";
} else if ((percent>=80) && (percent<90)){
greeting1 = "Very Good Work!";
greeting2 = "You passed with Merit!";
} else if (percent>90){
greeting1 = "Excellent Job!";
greeting2 = "You passed with Distinction!";
}
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|