On Wed, 16 Feb 2005 11:10:24 -0500, Jay <[EMAIL PROTECTED]> wrote: > On Thu, 17 Feb 2005 00:52:48 +1000, Alfred Vahau <[EMAIL PROTECTED]> wrote: > > Hi, > > I've been struggling with what should be a trivial problem. Perl is such > > a rich language that in formulating the logic, I've actually > > became confused. Partly because I took a C approach when I know that a > > veteran Perl programmer would write only a few lines to achive the same > > result. (The challenge coming from 'The Camel' 3rd ed. pp.119, 120). > > > > Alfred, > > I'm a little confused by your weighting here...it seems to me that GPA > = SUM(G * CC)/SUM(CC), where > > G = Cource Grade > CC = Course Credit. > > In the US, we often call (G*CC) Honor Points. > > So let's take student 386. Assuming a 4-point scale: > > Grade Credits Points > F 3.00 0 > C 3.00 6 > C 3.00 6 > D 2.00 4 > D 3.00 3 > D 3.00 3 > B 3.00 9 > C 3.00 6 > F 2.00 0 > ----------------------- > 36.00 37 > 37/36 = 1.027.. > > In other words, our formula is good, so we don't need the elaborate > lookup table. >
Yeah, ignore the match I did by hand. The progam is sound, though. --jay -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>