A long time since I've tried to tackle probabilities but I'd tackle it logically:
Assume 1000 women take the test.
40% of women are pregnant that take the test, so we have 600 not pregnant and 400 pregnant.
The test on the 600 non-pregnant women will give 582 negative and 18 positive results (97% accurate).
The test on the 400 pregnant women will give 396 positive and 4 negative results (99% accurate).
We have a total of 414 positive results and 396 of these are true positives.
So if a woman receives a positive result, the chance that she's actually pregnant is:
(396 / 414) x 100 = 95.65%
This is just my logical approach, so I could be wrong??