Add test code for calculating the total earned grades