This handy 2K program for computing compound interest features an interesting screen display and the option of changing your input values to compare possible investment strategies. If you keep a 16K memory pack hooked up to your machine, begin by first lowering RAMTOP to 2K by direct command: POKE 16389,72. NEW. Now type in the program, and SAVE. Your tape may now be used on either an unexpanded 2K TS1000 or a large memory configuration.
NOTE: If INKEY$ is any key other than (I),(P),or (T), the program retains the old values of these variables and returns the user to the menu. This arrangement eliminates a redundant error-catching routine.
HINT: When asked for “term in days”, you may input an expression like “5*365” saving a lot of figuring in your head.
10 LET X$="C O M P O U N D I N T E R E S T"
20 GOSUB 360
30 GOSUB 260
40 LET A=INT (100*P*(1+I/100)**(T/365))/100
50 CLS
60 GOSUB 360
70 PRINT "$";P;", INVESTED AT ";I;"▒/▒ FOR"
80 PRINT T;" DAYS, OR"
90 PRINT TAB 14;INT ((T/30.41666)*100+.5)/100;" MONTHS, OR"
100 PRINT TAB 14;INT ((T/365)*100+.5)/100;" YEARS YIELDS:"
110 PRINT "$";A-P;" INTEREST"
120 PRINT "FOR A TOTAL OF $";A
130 PRINT
140 PRINT "CHANGES? PRESS LETTER OF CHOICE."
150 PRINT
160 PRINT "(I)NTEREST RATE"
170 PRINT "(P)RINCIPAL"
180 PRINT "(T)ERM IN DAYS"
190 PRINT
200 IF INKEY$="" THEN GOTO 200
210 PRINT "ENTER (";INKEY$;")"
220 IF INKEY$="I" THEN INPUT I
230 IF INKEY$="P" THEN INPUT P
240 IF INKEY$="T" THEN INPUT T
250 GOTO 40
260 PRINT "INTEREST RATE: ";
270 INPUT I
280 PRINT I;"▒/▒"
290 PRINT "PRINCIPAL: ";
300 INPUT P
310 PRINT P
320 PRINT "TERM IN DAYS: ";
330 INPUT T
340 PRINT T
350 RETURN
360 PRINT
370 PRINT X$
380 FOR X=1 TO 8
390 PRINT "▒▒▒▒";
400 NEXT X
410 PRINT
420 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.