Previous PageNext Page

An alternate coding
Are the following equivalent to the original coding?
Original:

     IF  0 LE Score LT 65 THEN Grade='F'; ELSE 
     IF 65 LE SCORE LT 70 THEN Grade='D'; ELSE 
     IF 70 LE SCORE LT 80 THEN Grade='C'; ELSE 
     IF 80 LE SCORE LT 90 THEN Grade='B'; ELSE 
     IF       SCORE GE 90 THEN Grade='A';

Checking for high values first:

     IF SCORE GE 90 THEN Grade='A'; ELSE
     IF SCORE GE 80 THEN Grade='B'; ELSE 
     IF SCORE GE 70 THEN Grade='C'; ELSE 
     IF SCORE GE 65 THEN Grade='D'; ELSE 
     IF Score GE  0 THEN Grade='F'; 

Or the original without ELSEs:

     IF  0 LE Score LT 65 THEN Grade='F'; 
     IF 65 LE SCORE LT 70 THEN Grade='D'; 
     IF 70 LE SCORE LT 80 THEN Grade='C'; 
     IF 80 LE SCORE LT 90 THEN Grade='B'; 
     IF       SCORE GE 90 THEN Grade='A';

Don't forget to consider missing value.
If they are equivalent, is one better than the others?

Previous PageTable Of ContentsNext Page