The cost of each share is $20.95, and Zack buys 40 shares, so the cost of the shares is 20.95 * 40 = $838.00.
Zack's broker charges him 4% of each share as a transaction fee, so the total transaction fee is 0.04 * 20.95 * 40 = $33.28.
Therefore, the total cost of the transaction is $838.00 + $33.28 = $871.28.
The correct answer is B. $871.52.