10 KEY OFF
20 CLS
30 PRINT "CURRENT VALUE OF A TREASURY BILL"
40 DEFDBL P,B:DEFINT M,D,Y,I
50 PRINT
60 PRINT "               FACE VALUE ($)";
70 INPUT P
80 PRINT "        ISSUE DATE (MM,DD,YY)";
90 INPUT M,D,Y
100 GOSUB 490
110 REM  -- X3 = ABSOLUTE NUMBER OF DAYS FROM IMAGINARY
120 REM  --           DATE 00/00/00 TO ISSUE DATE
130 X3=A4
140 PRINT "     MATURITY DATE (MM,DD,YY)";
150 INPUT M,D,Y
160 GOSUB 460
170 REM  -- X4 = TOTAL NUMBER OF DAYS IN PERIOD
180 X4=A4-X3
190 IF X4>=0 THEN 230
200 PRINT
210 PRINT "BILLS DO NOT MATURE BEFORE ISSUED"
220 GOTO 390
230 PRINT "      TODAY'S DATE (MM,DD,YY)";
240 INPUT M,D,Y
250 GOSUB 460
260 REM  -- X3 = NUMBER OF DAYS FROM ISSUE TO TODAY
270 X3=A4-X3
280 IF X3>=0 THEN 320
290 PRINT
300 PRINT "BILLS HAVE NO VALUE BEFORE ISSUED"
310 GOTO 390
320 PRINT "        CURRENT PRICE BID (%)";
330 INPUT B
340 REM  -- X4 = NUMBER OF DAYS LEFT UNTIL MATURITY
350 X4=X4-X3
360 PRINT
370 PRINT "CURRENT VALUE =";
380 PRINT USING "$$#,###,###,###.##";P-P/100*B*X4/360
390 PRINT
400 PRINT "WOULD YOU LIKE TO RE-REUM THIS PROGRAM";
410 PRINT " USING NEW DATA (Y/N)?"
420 Z$=INKEY$:IF Z$="" THEN 420
430 IF Z$="Y" OR Z$="y" THEN 50
440 IF Z$="N" OR Z$="n" THEN 570
450 GOTO 400
460 REM  -- SUBROUTINE TO DETERMINE NUMBER OF DAYS BETWEEN IMAGINARY
470 REM  -- DATE 00/00/00 AND MM/DD/YY USING 365/366 DAY YEAR.
480 REM  -- REF. ACCOUNTS PAYABLE & ACCOUNTS RECEIVABLE (WANG), P.255
490 RESTORE
500 DATA 0,3,3,6,8,11,13,16,19,21,24,26
510 FOR I1=1 TO M
520 READ A4
530 NEXT I1
540 A4=A4+Y*365+INT(Y/4)+1+(M-1)*28+D
550 IF INT(Y/4)=Y/4 AND M<3 THEN A4=A4-1
560 RETURN
570 END