in reply to Passing input through a hash then displaying results
my $grade = <STDIN>; my %scores = ( "90" => "A", "80" => "B", "70" => "C", "60" => "D", "50" => "F"); my $letter_score = $scores{$grade}; if ($letter_score eq "A"){ #return this }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing input through a hash then displaying results
by ikegami (Patriarch) on Jan 23, 2007 at 07:15 UTC | |
by logie17 (Friar) on Jan 23, 2007 at 07:19 UTC | |
by ikegami (Patriarch) on Jan 23, 2007 at 07:24 UTC | |
by brayshakes (Acolyte) on Jan 23, 2007 at 07:42 UTC | |
by graq (Curate) on Jan 23, 2007 at 08:25 UTC |