The tricky part in this question is to see which numbers the percentage are referring to. Since we are asked about the percent profit, we don't need to use any absolute values in our calculation.
We start with the 40% That Tracey makes on the sales of the house. The 40% profit refers to the original house price, but the agent fee refers to the final sales price. As the sales price is 40% higher than the original purchase price, we need to convert the 5% fee into percent of the original price. For that, we can pick numbers. We assume that the original price was 100. The sales price them was 140, as it is 40% higher. The 5% agent fee of a final sales price of 140 is 7. After paying the agent, Tracey is therefore left with 133, or 33% of the original price.
Of that 33%, she then needs to pay 40% tax. We can directly calculate what is left for Tracey after the tax, 60% of her 33% pre-tax profit.
\(\frac{33}{100}*\frac{6}{10}=\frac{198}{1000}=19.8%\)
Answer D.