public function average($penalty, $num) { $full = $num * SCORE_FULL; return sprintf("Average score: %.2f\n", ($full + $penalty) / $num); }