home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / bcklib2.zip / AMORT.PRG < prev    next >
Text File  |  1993-01-16  |  2KB  |  52 lines

  1. /*
  2.     The source code contained within this file is protected under the
  3.     laws of the United States of America and by International Treaty.
  4.     Unless otherwise noted, the source contained herein is:
  5.  
  6.     Copyright (c)1990, 1991, 1992 BecknerVision Inc - All Rights Reserved
  7.  
  8.     Written by John Wm Beckner        THIS NOTICE MUST NOT BE REMOVED
  9.     BecknerVision Inc
  10.     PO Box 11945                      DISTRIBUTE ONLY WITH SHAREWARE
  11.     Winston-Salem NC 27116            VERSION OF THIS PRODUCT.
  12.     Fax: 919/760-1003
  13.  
  14. */
  15.  
  16. #include "beckner.inc"
  17. #define PMT_DATE     1
  18. #define PMT_AMOUNT   2
  19. #define PRINCIPAL    3
  20. #define INTEREST     4
  21. #define BALANCE      5
  22.  
  23. FUNCTION Main()
  24.    LOCAL cVersion := "v1.1", nNumPmts := 180, nLoan := 6320.00, GetList := {}
  25.    LOCAL nAPR := 9, dStart := dBegMonth(dSame()), nCtr, aSchedule
  26.    LOCAL nTotalPrinc := 0.00, nTotalInt := 0.00
  27.    CLS
  28.    @ 0,0 SAY 'Beckner Amortization Schedule '+cVersion
  29.    @ 1,0 SAY 'Copyright (c)1990 John Wm Beckner - All Rights Reserved'
  30.    @ 3,0 SAY '# of payments ............' get nNumPmts pict '999'
  31.    @ 4,0 SAY 'Starting balance .........' get nLoan pict '999,999.99'
  32.    @ 5,0 SAY 'First payment due date ...' get dStart
  33.    @ 6,0 SAY 'APR ......................' get nAPR pict '99.99999'
  34.    READ
  35.    aSchedule := mAmortSched(nLoan, nAPR, nNumPmts, dStart)
  36.    CLS
  37.    FOR nCtr := 1 TO nNumPmts
  38.       ? Str(nCtr, 4),                     /* payment number               */;
  39.             aSchedule[nCtr, PMT_DATE],    /* payment due date             */;
  40.             aSchedule[nCtr, PMT_AMOUNT],  /* payment amount due           */;
  41.             aSchedule[nCtr, PRINCIPAL],   /* principal                    */;
  42.             aSchedule[nCtr, INTEREST],    /* interest                     */;
  43.             aSchedule[nCtr, BALANCE]      /* balance due after payment    */
  44.       nTotalPrinc += aSchedule[nCtr, PRINCIPAL]
  45.       nTotalInt   += aSchedule[nCtr, INTEREST]
  46.       vPause()
  47.    NEXT
  48.    ?
  49.    ? 'Totals', nTotalPrinc, nTotalInt
  50.    vAnyKey()
  51. ENDFUNCTION
  52.