Answer:
a) expected cash flow per year (same for all 3 years) = (30% x $9 million) + (40% x $4 million) + (30% x -$1 million) = $4 million
initial outlay = $10 million
discount rate = 12%
NPV = -$10 + $4/1.12 + $4/1.12² + $4/1.12³ = -$0.39 million
b) assuming that the project is abandoned at the end of year 1:
NPV = -$10 + $4/1.12 + $6/1.12 = -$1.07 million
Actually things get worse if you decide to sell the project after year 1. The present value of the expected cash flows is higher than the present value of the salvage value.