Commit ba147572 authored by Robert Ricci's avatar Robert Ricci

Prettier output

parent e34ba6ba
......@@ -40,12 +40,13 @@ foreach my $student (@students) {
my ($typetotal, $typepossible) =
sum_pairs(values $scores{$student}{$type});
my $pct = $typetotal / $typepossible;
print "\t$type:\t$typetotal / $typepossible ($pct)\n";
my $weight = $weights{$type};
printf "\t%13s: %6.2f / %6.2f (%3.2f) (%5.2f%% of grade)\n", $type,
$typetotal, $typepossible, $pct, $weight*100;
push @studentscores, $pct * $weight;
my $studenttotal = reduce { $a + $b } @studentscores;
print "\tTOTAL:\t$studenttotal\n";
printf "\t%13s: %04.2f%%\n", "TOTAL", $studenttotal*100;
sub get_grade_for($$) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment