OK, this is what I have so far and I need to figure out the standard deviation and what I got doesn't really work, help me!!
use strict;
my $number=0;
my $line;
my $score;
my $std;
my $avg;
my $name;
my $sum;
my $totd;
open(IN, "pa5c.dat") || die ("Can't open file $!\n");
while($line = <IN>){
chomp($line);
++$number;
($name, $score) = split(/:/, $line);
$sum = $sum + $score;
$totd += abs($sum - $avg);
$std = $totd / $number;
}
$avg = $sum / $number;
printf "The class average is: %3.1f\n", $avg;
printf "The standard deviation is: %3.1f\n", $std;
__END__#pa5.pl
$totd is the total deviation. I'm supposed to get 5 for standard deviation but I get 261.3