in reply to Re: Conditional statement
in thread conditional statement
And in case you did not want to have to count then number of different numbers that get the same grade, you could assign it like this:
You just have to make sure the number at the end of the assignments is higher than the maximum number of scores with the same grade.my @grades; @grades[0..39] = ('F') x 50; @grades[40..49] = ('E') x 50; @grades[50..59] = ('D') x 50; @grades[60..64] = ('C') x 50; @grades[65..69] = ('C+') x 50; ...
Another option would be this:
my @grades; $_ = 'F' for @grades[0..39]; $_ = 'E' for @grades[40..49]; $_ = 'D' for @grades[50..59]; $_ = 'C' for @grades[60..64]; $_ = 'C+' for @grades[65..69]; ...
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
|---|