The data is read line by line. So each new line you get a new iteration of the loop, a new array, which starts at 0 again.
Using my code and your sub, you could just write: say "Weighted average: ", quiz(@fields[FIRST_QUIZ..LAST_QUIZ]) + exam(@fields[FIRST_EXAM..LAST_EXAM]) + final($fields[FINAL])
In reply to Re^3: Weighted averages
by Eily
in thread Weighted averages
by drose2211
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |