Remember that
The compound interest formula is equal to
In the 3.99% compounded semiannually
we have
r=3.99%=0.0399
n=2
substitute
and
the rate is r=1.0403-1=0.0403=4.03%
In the 3.8% compounded quarterly
we have
r=3.8%=0.038
n=4
substitute
the rate is r=1.0191-1=0.0191=1.91%
therefore
the 3.99% compounded semiannually is a better investment