//Use function for calculation of savings $fv1 = save1($pv, $int, $nYears); //Future value calculation $fv2 = save2($pv, $int, $nYears); //Future value calculation $fv3 = save3($pv, $int, $nYears); //Future value calculation $fv4 = save4($pv, $int, $nYears); //Future value calculation $fv5 = save5($pv, $nYears); //Future value calculation $fv6; //declare the future value to be returned by reference save6($pv, $int, $nYears, $fv6); //Future value calculation $fv7 = save7($pv, $int, $nYears); //Future value calculation //Display results echo "<p>Present Value = \$" . $pv . "</p>"; echo "<p>Interest Rate = " . $int * 100 . "%</p>"; echo "<p>Number of Years = " . $nYears . "</p>"; echo "<p>Future Value 1 = \$" . number_format($fv1, 2) . "</p>"; echo "<p>Future Value 2 = \$" . number_format($fv2, 2) . "</p>"; echo "<p>Future Value 3 = \$" . number_format($fv3, 2) . "</p>"; echo "<p>Future Value 4 = \$" . number_format($fv4, 2) . "</p>"; echo "<p>Future Value 5 = \$" . number_format($fv5, 2) . "</p>"; echo "<p>Future Value 6 = \$" . number_format($fv6, 2) . "</p>"; display($fv7); ?> </body> </html>
//Declare variables $pv = 100; //Present value in $ $int = 0.06; //Interest rate $nYears = 50; //Number of compunding periods in years $f1 = save1($pv, $int, $nYears); $f2 = save2($pv, $int, $nYears); $f3 = save3($pv, $int, $nYears); $f4 = save4($pv, $int, $nYears); $f5 = save5($pv, $nYears); $f6; save6($pv, $int, $nYears, $f6); echo "<p>Present Value = \${$pv}</p>"; echo "<p>Interest Rate = " . $int * 100 . "%</p>"; echo "<p>Number of Years = {$nYears}</p>"; echo "<p>Future Value 1 = \$" . number_format($f1, 2) . "</p>"; echo "<p>Future Value 2 = \$" . number_format($f2, 2) . "</p>"; echo "<p>Future Value 3 = \$" . number_format($f3, 2) . "</p>"; echo "<p>Future Value 4 = \$" . number_format($f4, 2) . "</p>"; echo "<p>Future Value 5 = \$" . number_format($f5, 2) . "</p>"; echo "<p>Future Value 6 = \$" . number_format($f6, 2) . "</p>"; disp7(save7($pv, $int, $nYears)); //209.129.8.2 is the class server... @ cis12.net //UN: 48939 //PW: 48939cis12 //Port 10000 ?> </body> </html>