A little bit more complicate program. It calculates individual student averages, then when you want, it can calculate the full class average.
Here is the
code
if you are curious.