#!/usr/local/bin/perl # $args = $ENV{'QUERY_STRING'}; if (length($args) < 3) { print<Tuition Savings Calculator

Tuition Savings Calculator


Well, you can congratulate me, we're having a second child! One thing that it reminded me is the value of getting free tuition for my kids by working here at a university! I was curious how much it was worth being a severely underpaid academic in terms of my free tuition benefits.

So here you put in the current astronomical annual tuition of your favorite institution and what you think your average tuition inflation and investment return will be. Then put in the years until your children go to school and how much you have already to invest and how much you will contribute each year.


Current Tuition Price
Tuition Inflation %
Investment Return %
Years Until First Child Starts College
Years Until Second Child Starts College
Years Until Third Child Starts College
Years Until Fourth Child Starts College
Current Savings
Annual Contribution to Savings
Contribution Inflation %
Marginal Tax Rate (0 for Deferred) %
Use 99 for those children you don't plan on having!

Hugh Chou EOF } else { #($pmin,$pmax,$imin,$imax,$term) = split("&",$args); @v = split("&",$args); $tbl = "N"; for ($i=0; $i<=$#v; $i++) { ($key,$val) = split("=",@v[$i]); $val =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig; $val =~ s/,//g; $aa{$key} = $val; } $inf = $aa{"inf"}/100; $cti = $aa{"cti"}/100; $yld = $aa{"yld"}/100; $mtr = $aa{"mtr"}/100; $tuit = $aa{"amt"}; print "Content-type: text/html\n\n"; print "Tuition Calculator\n"; print "

Tuition Calculator

\n"; for ($i=1; $i<25; $i++) { $tuit = $tuit * (1 + $inf); if ($i >= $aa{"ch1"} && $i <= $aa{"ch1"}+3) { @c1[$i] = $tuit; @t[$i] = @t[$i] + $tuit; } if ($i >= $aa{"ch2"} && $i <= $aa{"ch2"}+3) { @c2[$i] = $tuit; @t[$i] = @t[$i] + $tuit; } if ($i >= $aa{"ch3"} && $i <= $aa{"ch3"}+3) { @c3[$i] = $tuit; @t[$i] = @t[$i] + $tuit; } if ($i >= $aa{"ch4"} && $i <= $aa{"ch4"}+3) { @c4[$i] = $tuit; @t[$i] = @t[$i] + $tuit; } } for ($i=25; $i>0; $i--) { $bal = $bal / (1 + $yld); if (@t[$i] > 0) { $bal = $bal + @t[$i]; } @bb[$i] = $bal; } printf("

You needed a tax deferred current balance (no contributions) of \$ %9.2f

\n",$bal); $bal = $aa{"sav"}; $cnt = $aa{"cnt"}; if ($cnt > 0) { printf("

Your contributions of \$ %6d /year will help

\n",$cnt); } print"\n"; $tuit = $aa{"amt"}; print "
YrTuitionStart BalanceChild 1Child 2Child 3Child 4Taxes\n"; print "End Balance\n"; for ($i=1; $i<25; $i++) { $tuit = $tuit * (1 + $inf); $bbal = $bal; $tx = $yld * $bal * $mtr; $bal = $bal * (1 + $yld) + $cnt - @c1[$i] - @c2[$i] - @c3[$i] - @c4[$i] - $tx; $cnt = $cnt * (1 + $cti); if ($bal > 0) { printf("
%2d%6d%8d%6d%6d%6d%6d%6d%8d\n", $i,$tuit,$bbal,@c1[$i],@c2[$i],@c3[$i],@c4[$i],$tx,$bal); } else { $poof = 1; $cnt = 0; } } print "
\n"; if ($poof == 1) { print "

Sorry, you need to go back and save more money!

\n"; } else { print "

Congratulations! You can send your child(ren) to college!

\n"; } print "
To Mortgage Site\n"; }