use strict; use warnings; my ($score) = @ARGV; die "Score must be less than or equal to 100.\n" if $score > 100; my $letter_grade = $score <= 39 ? 'F' : $score <= 49 ? 'E' : $score <= 59 ? 'D' : $score <= 64 ? 'C' : $score <= 69 ? 'C+' : $score <= 74 ? 'B' : $score <= 79 ? 'B+' : 'A' ; print "The student has gotten a $letter_grade for the score of $score\ +n";
In reply to Re: conditional statement
by BillKSmith
in thread conditional statement
by victorlai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |