CAn any one suggest a pattern for checking the newline character at the end
of line?
Problem: Actually the requirement is that I want to read no. of lines by
comparing the newline character which will tell that this is the end of
paragraph? Can anyone send me the code for this or any alternative solution
to read the paragraph from a text file?
Thanks in advance.
Arvind Bir
----- Original Message -----
From: "bdale16" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 10, 2001 1:13 PM
Subject: numb array getting value for letter array
? 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