Not really familiar with how to calculate a GPA but from your code it looks like you are trying to calculate a simple weighted mean, where you have assigned values of A->4, B->3, C->2, D->1. One problem I can see is that you are using "=" instead of "==" for the equivalence tests in the if statements. Anyway another approach would be to use an array.
Here is an untested example that may help point your in the right direction.
Code:
awk '
BEGIN {
g=0.0;
c=0.0;
a["A"]=4;
a["B"]=3;
a["C"]=2;
a["D"]=1;
}
{
g+=a[$4]*$3;
c+=$3;
}
END {
print g/c;
}
'
Evo2.