Use compound interest formula F=P(1+i)^n twice, one for each deposit and sum the two results.
For the P=$40,000 deposit, i=10%/2=5% (semi-annual) number of periods (6 months), n = 6*2 = 12 Future value (at end of year 6), F = P(1+i)^n = 40,000(1+0.05)^12 = $71834.253
For the P=20000, deposited at the START of the fourth year, which is the same as the end of the third year. i=5% (semi-annual n=2*(6-3), n = 6 Future value (at end of year 6) F=P(1+i)^n = 20000(1+0.05)^6 = 26801.913
Total amount after 6 years = 71834.253 + 26801.913 =98636.17 (to the nearest cent.)