To calculate the answer, remember that:
Starting Amount (1 + Growth Rate)Number of Years = Ending Amount
So under the various scenarios in the question we have:
$5,000(1 + .02)20 = $5,000(1.49) = $7,450
$5,000(1 + .02)40 = $5,000(2.20) = $11,000
$5,000(1 + .04)40 = $5,000(4.80) = $24,000
$5,000(1 + .06)40 = $5,000(10.29) = $51,450