• + 0 comments
    awk '{
        total=$2+$3+$4
        avg=total/3
        if ( avg >= 80 ) grade="A";
        else if ( avg >= 60 ) grade="B";
        else if ( avg >= 50 ) grade="C";
        else grade="FAIL"
        
        print $0" : "grade
    
    }'