Listing of program r51_mgage.cgi
#! /usr/local/bin/regina
/* Mortgage computation: process data from p50_mgage.cgi */
/*-----------------------------------------------------------------*/
numeric digits 12
call setdll /* loads the HHNS shared library */
C = "" /* in case nothing was entered in the loan amount field */
N = "" /* in case nothing was entered in the duration field */
/*--- this will setup the Rexx variables his_name ans his_pwd ---*/
call CgiInit "TITLE='Mortage' BGCOLOR=FFFFFF"
say "Missing or bad entry"
/* Bernouilli's formulae : R = C x T x (1+T)**N / ( (1+T)**N - 1) */
else do
z = t/1200 /* monthly rate */
m = n * 12 /* duration in monthes */
w = (1+z)**m /* work area */
R = c*z*w / (w-1)
end
call CgiEnd
return 0
Back Home