Judging from the formulas given, I assume that the interest rate for the second account is 7% per quarter.
If he account is compounded 7% annually, the value of the account after 6 years is A=18000(1+0.07)^6=$27,013.15.
If the account is compounded 7% quarterly, the value of the account after 6 years (or 24 quarters) is A=18000(1+0.07)^(6*4)=$91,302.61.
The difference in interest gained is also the difference in the final values of both accounts: $91,302.61-$27,013.15=$64,289.46.
However, if what you mean is 7% PER YEAR compounded QUARTERLY, this is a different story. This is the same as compounding at 7%/4=1.75% every quarter.