Dumb Sort Question

Gregory Lypny Feedback at videotron.ca
Thu Dec 13 10:04:01 EST 2001


Hi Everyone,

     I've created a neat little function that calculates stats and a 
distribution for test grades very quickly.  To create a frequency 
distribution of letter grades (how many A's, B's, C's, and so on), I use 
an associative array where the keys are A+, A, A-, B+, B, B-, ..., F, and 
I just plunk number grades into each element according to my conversion 
criteria.

     My problem is that when I put the keys into a variable, say, Distn, 
and sort it, it comes out as

     A
     A+
     A-

     rather than

     A+
     A
     A-

     which still represents the correct frquencies but is not convenient 
to read.  Is there a handy trick to sorting Distn to get the order I 
want?  I've tried to precede each key by a number ( 1  A+,  2 A, 3  A-, 
...) and sort it, but I get gobbledeegoop.

     Regards,

          Greg

 

____________________________________________________________
Gregory Lypny
Associate Professor
Concordia University
____________________________________________________________
"They had the best selection,
 The were poisoned by protection,
 There was nothing that they needed,
 They had nothing left to find."
   - Neil Young


E-mail forum:   markets at concordia.ca
Visit Pareto at http://rubbersoul.concordia.ca
Visit Borsa at http://rubbersoul.concordia.ca/Borsa_Classroom
Crash site for notes and quizzes at 
http://homepage.mac.com/gregorylypny/FileSharing1.html





More information about the metacard mailing list