Add test code for calculating course grade