home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG055.ARC
/
AMORTIZR.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
2KB
|
91 lines
10 PRINT
20 PRINT "LOAN AMORTIZATION"
30 PRINT
40 PRINT
50 INPUT "ENTER INTEREST RATE"; PERCENT
60 PRINT
70 FMT$ = "##/## #,###.## #,###.## ##,###.## ###,###.##"
80 IF PERCENT = 0 GOTO 100
90 IF PERCENT < 1 GOTO 130
100 PRINT "INTEREST MUST BE DECIMAL FRACTION!!"
110 PRINT
120 GOTO 50
130 INPUT "ENTER PRINCIPAL"; PRINCIPAL#
140 PRINT
150 IF PRINCIPAL# > 0 GOTO 190
160 PRINT "PRINCIPAL MUST BE IN DOLLARS AND CENTS!!"
170 PRINT
180 GOTO 130
190 INPUT "ENTER MONTHLY PAYMENT"; PAYMENT
200 PRINT
210 IF PAYMENT > 0 GOTO 250
220 PRINT "MONTHLY PMT MUST BE IN DOLLARS AND CENTS!!"
230 PRINT
240 GOTO 190
250 INPUT "ENTER STARTING MONTH (1-12)"; MONTH
260 PRINT
270 IF MONTH > 0 THEN IF MONTH < 13 GOTO 310
280 PRINT "MONTH MUST BE 1 THRU 12!!"
290 PRINT
300 GOTO 250
310 INPUT "ENTER STARTING YEAR (YY)"; YEAR
320 IF YEAR > 0 GOTO 370
330 PRINT
340 PRINT "YEAR MUST BE ENTERED!!"
350 PRINT
360 GOTO 310
370 MPERCENT = PERCENT / 12
380 PRINT
390 PRINT
400 PRINT
410 PRINT
420 PRINT
430 PRINT " DATE PAYMENT INTEREST PRINCIPAL BALANCE"
440 PRINT
450 FOR I = MONTH TO 12
460 IF PRINCIPAL# = 0 GOTO 530
470 PAIDINT = PRINCIPAL# * MPERCENT
480 PAIDINT = PAIDINT * 100
490 PAIDINT = INT (PAIDINT)
500 PAIDINT = PAIDINT / 100
510 PAIDPRIN = PAYMENT - PAIDINT
520 PRINCIPAL# = PRINCIPAL# - PAIDPRIN
530 PRINT USING FMT$; MONTH, YEAR, PAYMENT, PAIDINT, PAIDPRIN, PRINCIPAL#
540 TOTINT = TOTINT + PAIDINT
550 TOTPRIN = TOTPRIN + PAIDPRIN
560 MONTH = MONTH + 1
570 IF PRINCIPAL# = 0 GOTO 600
580 IF PRINCIPAL# < PAYMENT THEN GOSUB 810
590 NEXT I
600 PRINT
610 A = YEAR + 1900
620 PRINT A; "TOTALS: ";
630 PRINT USING "##,###.##"; TOTINT,
640 PRINT USING " ###,###.##"; TOTPRIN
650 TOTINT = 0
660 TOTPRIN = 0
670 FOR I = MONTH TO 12
680 PRINT
690 NEXT I
700 IF PRINCIPAL# = 0 GOTO 860
710 PRINT
720 PRINT
730 PRINT
740 PRINT "CONTINUE";
750 INPUT X$
760 IF X$ <> "y" THEN IF X$ <> "Y" GOTO 880
770 MONTH = 1
780 PRINCIPAL# = 0
790 YEAR = YEAR + 1
800 GOTO 380
810 PAIDINT = PRINCIPAL# * MPERCENT
820 PAYMENT = PRINCIPAL# + PAIDINT
830 PAIDPRIN = PRINCIPAL#
840 PRINCIPAL# = 0
850 RETURN
860 PRINT
870 PRINT
880 END
820 PAYMENT = PRINCIPAL# + PAIDINT
830 PAIDPRIN = PRINCIPAL#
840