I assume that you are expressing an annual rate of 4% compounded annually, quarterly, semi annually, and monthly.
The yearly equation is the base: y = y0(1 + i)t where i is annual rate and t is years. If you want to compound for some subdivision of a year (like a quarter), you will use 1/4 of i and you will compound 4 times every year or
y = y0(1 + i/4)4t
monthly would use 12 instead of 4
I'll leave semiannually to you.

JACQUES D.
02/08/22
Linda R.
0h ok wasn't sure so 1/4 for quarter and 12 for monthly02/08/22