BEGIN { print "ACTUALLY THE END OF LECTURE" } { if ($5 ~/y/) { pst=0 gst=0 pst=$3 * 0.08 gst=$3 * 0.07 total_pst = total_pst + pst total_gst = total_gst + gst printf "%-15s %3.2f %3.2f\n", $1, pst, gst } } END { printf "%-15s %4.2f %4.2f\n", "Totals: ", total_pst, total_gst }