? How do i affect this type of result to my existing code
if a grade of a 90-100 = an A
and a grade of  80-90   = a   B
and a grade of  70-80 = a C
and a grade of 60-70 = a D
and a grade of 0-60 = a F

I understand i am creating 2 more arrays but i need to get a range and assign it to a 
Letter

 any help would be appreciated thanks
sincerely robert bush
[EMAIL PROTECTED]


print "Enter Name Of Student:    ";
$name = <STDIN>; 
chomp ($name);

$grade1=gradeinput("First");
$grade2=gradeinput("Second");
$grade3=gradeinput("Third");

$avg= ($grade1 + $grade2 + $grade3) /3;

# new code @letter = ("A..D" ,"F");
# new code @chart = (90, 80, 70, 60, 0);

# new code for ($I=0, $I<5, $I++)
#new code {
#new code if ($avg >= $chart[I])
# new code {
 #get $grade
#new code }
#new code }

print "$name received $avg \n ";

sub gradeinput
{ #beg
 my ($prompt, $grade);
 $prompt = $_[0];
{ #first loop
print "Enter $prompt grade from 0 to 100  ";
$grade = <STDIN>;
chomp ($grade);
if ($grade <0 || $grade >100)

  { #sec loop beg
  print "You Must Enter a Number is Beteween Zero and Less Than 100\n";
  redo
  } #end of first loop
}  #end of second loop
return ($grade);

}#end




Reply via email to