# Math Help - Building a web based pension calculator

1. ## Building a web based pension calculator

Hi there

This is my first posting, so apologies if this is not the correct board or not a question members would respond to normally.

We are currently trying to put together a web based pension calculator and am unsure about how to go about trying to put the equation together for our programmers to begin building it.

The calculator itself is meant as an estimate only to give people an idea of how much they may need/how much of a shortfall they may have.

The calculator will take into consideration:

-current age
- age of retirement
-current salary
-existing fund
-target income in retirement per year/per annum
-the ability to escalate contributions by the rate of inflation assuming that this is 2.5%

- the ability to change the percentage of tax free cash
- personal contributions, per month
-the ability to delay starting your pension by a number of years

with the hope to get an example of

- total pension fund
-tax free amount
-projected income and percentage of target income
-preojected income and percentage of target income if you delay by x years.

Any help would be very much appreciated, even a point in the right direction!

2. Originally Posted by lawley06
Hi there

This is my first posting, so apologies if this is not the correct board or not a question members would respond to normally.

We are currently trying to put together a web based pension calculator and am unsure about how to go about trying to put the equation together for our programmers to begin building it.

The calculator itself is meant as an estimate only to give people an idea of how much they may need/how much of a shortfall they may have.

The calculator will take into consideration:

-current age
- age of retirement
-current salary
-existing fund
-target income in retirement per year/per annum
-the ability to escalate contributions by the rate of inflation assuming that this is 2.5%

- the ability to change the percentage of tax free cash
- personal contributions, per month
-the ability to delay starting your pension by a number of years

with the hope to get an example of

- total pension fund
-tax free amount
-projected income and percentage of target income
-preojected income and percentage of target income if you delay by x years.

Any help would be very much appreciated, even a point in the right direction!

The first thing you need to decide is the programming language. There are quite a few options out there: Java, PHP, Perl, JavaScript ?? I am not an an expert in any of these but I am sure you can get a lot of help in a computer programming forum, like the coding forum.

Good luck with the project!

3. in perl:

the following file is named math.cgi

#!/usr/bin/perl -wT
use CGI qw(:standard);

param(currentsalary) = $currentsalary; param(currentcash) =$current_cash;
param(age) = $age; param(retirement) =$retirement_age;
param(inflation) = $inflation; #make inflation a decimal$inflation = ($inflation / 100); #starting total is whatever we were told$total += $current_cash; #loop placeholder because its easier$ageloop = $age; #loop because math is hard while ($ageloop /= $retirement_age){$ageloop++;

$total =$total + $currentsalary; #INFLATION STRIKES! (the good kind)$total = $total + ($total * $inflation); } print "Content-type: text/html\n\n"; print "Your total earnings: " +$total + "<br>";
print "over " + ($retirement_age -$age) + " years" + "<br>";
print "with " + (\$inflation / 100) + "inflation rate." + "<br>";

the following file is math.html

<body>

<form action="math.cgi" method="GET">
Enter some text here:
Current Salary: <input type="text" name="currentsalary" size="10"><br>
Current Funds: <input type="text" name="currentcash" size="10"><br>
Age: <input type="text" name="age" size="10"><br>
Age at Which you will retire: <input type="text" name="retirement" size="10"><br>
Inflation rate (%): <input type="text" name="inflation" size="10"><br>

<input type="submit"><p>
</form>

</body></html>

that might work. i didnt test it.

i cant determine the tax-free amount without tax information
what do you mean by delay of years?
and what are the pension requirements.

also, for this to work you have to have a web-server...

4. I am new to forum so i don't know anything about perl......
...........

Health Insurance TX | Texas Insurance Broker | Insurance Agency TX