|(Gross salary - tax) - pension = net pay .|
That is assuming that pension contributions are taxable.
If pension contributions are tax free then it will be:
(Gross Salary - Pension) - Tax = net pay.
However you will need to know the percentage tax rate to come up with an accurate answer.
The rest you will have to work out for yourself. That is what computer programming is all about, problem solving. Not getting someone else to do it for you.