Am I the only one this reeks of homework to? In general, people are happy to help if you at least start with some code and specific questions about it (and why it's not working).
Maybe you can turn in the following one liner (for Windows)...?
C:\temp>perl -F, -ane "BEGIN{$c = shift} push @a, [@F]; END{print join
+(',' => @$_) for sort {($a->[abs($c)-1] cmp $b->[abs($c)-1]) * $c} (@
+a)};" -- -3 grades.csv
Jim,72,IL
Rob,63,FL
Mike,67,CA
Chan,32,AZ
... where the only argument (before the input file) specifies on which column to sort and in which direction (negative column value for descending sort, positive for ascending).