For each of the 15 assignment grades calculate
where G is the grade on that assignment and M is the maximum possible grade on that assignment. Add these 15 values to obtain a total A. The maximum possible value of A is 40.
For each of the 3 test grades calculate
where G is the grade on the test and G is the maximum possible grade on the test. Add these 3 value to obtain a total T. The maximum possible value of T is 60.
A + T is the semester grade.