home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / MS_DEV / VID / SERVER / ASF / DATA.Z / script7.asp < prev    next >
Text File  |  1996-10-22  |  2KB  |  75 lines

  1. <H3><a name="finsamp">Use this form to determine the future value of a savings plan.</a></H3> 
  2. <FORM METHOD=POST ACTION="atumd3.asp#note"> 
  3. <TABLE> 
  4. <TR> 
  5. <TD>How much do you plan to save each month? 
  6. <TD><INPUT TYPE=TEXT NAME=Payment> 
  7. <TR> <TD>Enter the expected interest annual percentage rate. 
  8. <TD><INPUT TYPE=TEXT NAME=APR> 
  9. <TR> 
  10. <TD>For how many months do you expect to save? 
  11. <TD><INPUT TYPE=TEXT NAME=TotPmts> 
  12. <TR> 
  13. <TD>Do you make payments at the beginning or end of month? 
  14. <TD><INPUT TYPE=RADIO NAME=PayType VALUE="Beginning" CHECKED>Beginning 
  15. <INPUT TYPE=RADIO NAME=PayType VALUE="End">End 
  16. <TR> 
  17. <TD>How much is in this savings account now? 
  18. <TD><INPUT TYPE=TEXT NAME=PVal> 
  19. <TR> 
  20. <TD> 
  21. <TD><INPUT TYPE=SUBMIT VALUE=" Calculate Future Value ">
  22. </TABLE>
  23. <%
  24. If Request.form("Payment")<>"" then
  25. ' Check to see if an Annual Percentage Rate 
  26. ' was entered 
  27. If IsNumeric(Request("APR")) Then 
  28. ' Ensure proper form. 
  29. If Request("APR") > 1 Then 
  30. APR = Request("APR") / 100 
  31. Else 
  32. APR = Request("APR") 
  33. End If 
  34. Else 
  35. APR = 0 
  36. End If 
  37. ' Check to see if a value for Total Payments 
  38. ' was entered 
  39. If IsNumeric(Request("TotPmts")) Then 
  40. TotPmts = Request("TotPmts") 
  41. Else 
  42. TotPmts = 0 
  43. End If
  44. ' Check to see if a value for Payment Amount 
  45. ' was entered 
  46. If IsNumeric(Request("Payment")) Then 
  47. Payment = Request("Payment") 
  48. Else 
  49. Payment = 0 
  50. End If 
  51. ' Check to see if a value for Account Present Value 
  52. ' was entered 
  53. If IsNumeric(Request("PVal")) Then 
  54. PVal = Request("PVal") 
  55. Else 
  56. PVal = 0 
  57. End If
  58. If Request("PayType") = "Beginning" Then 
  59. PayType = 1 ' BeginPeriod 
  60. Else 
  61. PayType = 0 ' EndPeriod 
  62. End If 
  63. ' Create an instance of the Finance object 
  64. Set Finance = Server.CreateObject("MS.Finance") 
  65.  
  66. ' Use your instance of the Finance object to 
  67. ' calculate the future value of the submitted 
  68. ' savings plan using the HTML form and the 
  69. ' CalcFV method 
  70. FVal = Finance.CalcFV(APR / 12, TotPmts, -Payment, -PVal, PayType) 
  71. %>
  72.  
  73. <H3>Your savings will be worth <% = FVal %>.</H3>
  74. <%End If %>
  75.