sub gpa_Point{
$grade = @_[0];
if($grade eq "A+")
{return 4;}
elsif($grade eq "A")
{ return 4;}
elsif($grade eq "A-")
{return 3.7;}
elsif($grade eq "B+")
{ return 3.3;}
elsif($grade eq "B")
{ return 3;}
elsif($grade eq "B-")
{ return 2.8;}
elsif($grade eq "C+")
{ return 2.5;}
elsif($grade eq "C")
{ return 2;}
elsif($grade eq "C-")
{ return 1.8;}
elsif($grade eq "D")
{ return 1.5;}
elsif($grade eq "F")
{ return 0;}
else
{return -1;}
}
print gpa_Point("b-"); # change value to check for multiple grades
No comments:
Post a Comment