home *** CD-ROM | disk | FTP | other *** search
- 100 DEFINT A,G,I,K,M,N,P,S,T,U,W: DEFDBL B,C,D,L,O
- 101 DEFSNG E,F,H,J,Q,R,V,X,Y,Z
- 105 REM $INCLUDE: 'COMMON.BAS'
- 110 REM $INCLUDE: 'WGETSTRN.BAS'
- 115 REM $INCLUDE: 'GETSTRN.BAS'
- 600 REM Read titles of assumptions from TITLES.DAT
- 605 OPEN "I",1,"TITLES.DAT"
- 610 PRINT " Reading titles of assumptions from TITLES.DAT"
- 615 FOR I1=1 TO 4: INPUT #1,E$(I1): NEXT I1
- 620 CLOSE #1
- 1000 REM Retrieve historical amounts
- 1005 OPEN "I",1,"OLDAWBI.DAT"
- 1006 PRINT " Reading historical amounts from OLDAWBI.DAT"
- 1008 INPUT #1,N4: N2=N4+15: N6=N2-2
- 1010 FOR I1=25 TO N4: INPUT #1,C(2,I1): NEXT I1
- 1011 FOR I1=1 TO N6: INPUT #1,B(5,I1): NEXT I1
- 1012 FOR I1=1 TO N2: INPUT #1,B(1,I1): NEXT I1
- 1013 FOR I1=1 TO N2: INPUT #1,B(4,I1): NEXT I1
- 1014 FOR I1=1 TO N2: INPUT #1,B(2,I1): NEXT I1
- 1015 CLOSE #1
- 1018 REM Print historical amount menu
- 1020 CLS: GOSUB 2000: PRINT " ";: GOSUB 9870
- 1025 PRINT STRING$(20," ");"Review or update historical amounts";
- 1030 PRINT STRING$(20," "): GOSUB 2000: PRINT: PRINT
- 1050 GOSUB 9860: PRINT " Enter choice for review or update"
- 1051 PRINT " 0 to skip review of historical amounts"
- 1052 PRINT " 1 to review historical amounts"
- 1053 PRINT " 2 to update historical amounts"
- 1055 PRINT " > ";: K8=VAL(FNGETSTRN$(1))
- 1060 IF K8<0 OR K8>2 THEN BEEP: GOTO 1050
- 1065 ON K8+1 GOTO 1800,1100,1068
- 1068 REM print warning
- 1070 CLS: GOSUB 2000: PRINT " ";: GOSUB 9870
- 1071 PRINT STRING$(33," ");"Warning!";STRING$(34," "): GOSUB 2000
- 1073 PRINT: PRINT: GOSUB 9850: PRINT " You are about to update the ";
- 1074 PRINT "historical amounts necessary to compute Social"
- 1075 PRINT " Security benefits. This should be done once a year, ";
- 1076 PRINT "around November 1,"
- 1077 PRINT " when the new amounts are announced.": PRINT
- 1078 PRINT " If you continue, you will need the average wage for";
- 1079 PRINT STR$(1937+N6);", the wage base"
- 1080 PRINT " (and old-law wage base) for";STR$(1937+N2);
- 1081 PRINT ", and the benefit increase for Dec";STR$(1951+N4);"."
- 1082 PRINT " You will also need the annual minimum wage for";
- 1083 PRINT STR$(1937+N2);"; you can assume that"
- 1084 PRINT " it is the same as for 1987:";STR$(B(2,N2));".": PRINT
- 1085 PRINT " All four sets of projected average wages and benefit ";
- 1086 PRINT "increases will be": PRINT " automatically updated once ";
- 1087 PRINT "you have updated the historical amounts.": PRINT
- 1088 GOSUB 9860: PRINT " Do you want to continue? (y or n) > ";
- 1089 C$=FNGETSTRN$(1): GOSUB 9850
- 1090 IF LEN(C$)<=0 THEN BEEP: GOTO 1088
- 1091 GOSUB 2100: IF C$<>"Y" AND C$<>"N" THEN BEEP: GOTO 1088
- 1095 IF C$<>"Y" THEN 1800
- 1100 REM Display average wages
- 1103 FOR K1=1 TO N5: B(0,K1)=B(5,K1): NEXT K1
- 1105 G1=1937: G2=1936+N6: GOSUB 2200: GOSUB 2700
- 1110 GOSUB 9860: LOCATE 22,33: PRINT " Average wages "
- 1115 IF K8<2 THEN 1130
- 1120 GOSUB 2300: B(5,N6+1)=B(0,G2+1-1936): G2=G2+1
- 1130 GOSUB 2800
- 1200 REM Display wage bases
- 1203 FOR K1=1 TO N5: B(0,K1)=B(1,K1): NEXT K1
- 1205 G1=1937: G2=1936+N2: GOSUB 2200: GOSUB 2700
- 1210 GOSUB 9860: LOCATE 22,35: PRINT " Wage bases "
- 1215 IF K8<2 THEN 1230
- 1220 GOSUB 2300: B(1,N2+1)=B(0,G2+1-1936): G2=G2+1
- 1230 GOSUB 2800
- 1300 REM Display old-law wage bases
- 1303 FOR K1=1 TO N5: B(0,K1)=B(4,K1): NEXT K1
- 1305 G1=1937: G2=1936+N2: GOSUB 2200: GOSUB 2700
- 1310 GOSUB 9860: LOCATE 22,31: PRINT " Old-law wage bases "
- 1315 IF K8<2 THEN 1330
- 1320 GOSUB 2300: B(4,N2+1)=B(0,G2+1-1936): G2=G2+1
- 1330 GOSUB 2800
- 1400 REM Display minimum wages
- 1403 FOR K1=1 TO N5: B(0,K1)=B(2,K1): NEXT K1
- 1405 G1=1937: G2=1936+N2: GOSUB 2200: GOSUB 2700
- 1410 GOSUB 9860: LOCATE 22,33: PRINT " Minimum wages "
- 1415 IF K8<2 THEN 1430
- 1420 GOSUB 2300: B(2,N2+1)=B(0,G2+1-1936): G2=G2+1
- 1430 GOSUB 2800
- 1500 REM Display benefit increases
- 1503 FOR K1=1 TO N7: B(0,K1)=C(2,K1): NEXT K1
- 1505 G1=1975: G2=1950+N4: GOSUB 2200: GOSUB 2900
- 1510 GOSUB 9860: LOCATE 22,31: PRINT " Benefit increases "
- 1515 IF K8<2 THEN 1530
- 1520 GOSUB 2300: C(2,N4+1)=B(0,G2+1-1936): G2=G2+1
- 1530 GOSUB 2800
- 1550 GOSUB 9860: IF K8<2 THEN 1800
- 1600 REM Save to disk
- 1605 CLS: GOSUB 2000: PRINT " ";: GOSUB 9870
- 1610 PRINT STRING$(31," ");"Save to disk";STRING$(32," ")
- 1615 GOSUB 2000: GOSUB 9860
- 1620 PRINT: PRINT: PRINT " Do you want to save the updated values";
- 1625 PRINT " to disk? (y or n) > ";: C$=FNGETSTRN$(1): GOSUB 9850
- 1626 IF LEN(C$)<=0 THEN BEEP: GOTO 1620
- 1627 GOSUB 2100: IF C$<>"Y" AND C$<>"N" THEN BEEP: GOTO 1620
- 1630 IF C$<>"Y" THEN 1800
- 1635 OPEN "O",1,"OLDAWBI.DAT"
- 1640 PRINT " Writing historical amounts to OLDAWBI.DAT"
- 1645 PRINT #1,N4+1
- 1650 FOR I1=25 TO N4+1: PRINT #1,USING "###.#";C(2,I1): NEXT I1
- 1655 FOR I1=1 TO N6+1: PRINT #1,USING "######.##";B(5,I1): NEXT I1
- 1660 FOR I1=1 TO N2+1: PRINT #1,USING "######.##";B(1,I1): NEXT I1
- 1665 FOR I1=1 TO N2+1: PRINT #1,USING "######.##";B(4,I1): NEXT I1
- 1670 FOR I1=1 TO N2+1: PRINT #1,USING "######.##";B(2,I1): NEXT I1
- 1675 CLOSE #1
- 1700 REM Update assumptions
- 1701 FOR I1=1 TO 4: IF T6>0 THEN 1776
- 1702 CLS: GOSUB 2000: PRINT " ";: GOSUB 9870
- 1704 PRINT STRING$(28," ");"Update assumptions";STRING$(29," ")
- 1706 GOSUB 2000: GOSUB 9860
- 1710 PRINT: PRINT: PRINT " Updating assumptions, set";I1
- 1712 J$="BI"+CHR$(48+I1)+".DAT": OPEN "I",1,J$
- 1714 INPUT #1,K1: IF K1=1951+N4 THEN 1722
- 1716 GOSUB 9840: PRINT " Benefit increase assumptions do not start ";
- 1718 PRINT "in";1951+N4: PRINT " Please check assumptions": CLOSE #1
- 1720 BEEP: GOSUB 3000: T6=61: GOTO 1776
- 1722 FOR K1=N4+1 TO N7: INPUT #1,C(2,K1): NEXT K1
- 1724 CLOSE #1: OPEN "O",1,J$
- 1726 PRINT #1,1952+N4
- 1728 FOR K1=N4+2 TO N7: PRINT #1,USING "###.#";C(2,K1): NEXT K1
- 1730 CLOSE #1
- 1732 J$="CU"+CHR$(48+I1)+".DAT": OPEN "I",1,J$
- 1734 FOR K1=1 TO 8: FOR K2=1 TO 10: INPUT #1,F(K2,K1)
- 1736 NEXT K2: NEXT K1: CLOSE #1: OPEN "O",1,J$
- 1738 FOR K1=2 TO 8: FOR K2=2 TO 10: PRINT #1,USING "###.#";F(K2,K1)
- 1740 NEXT K2: PRINT #1,USING "###.#";0!: NEXT K1
- 1742 FOR K2=1 TO 10: PRINT #1,USING "###.#";0!: NEXT K2
- 1744 CLOSE #1
- 1746 J$="AW"+CHR$(48+I1)+".DAT": OPEN "I",1,J$
- 1748 INPUT #1,K1: IF K1=1937+N6 THEN 1756
- 1750 GOSUB 9840: PRINT " Average wage assumptions do not start in";
- 1752 PRINT 1937+N6: PRINT " Please check assumptions": CLOSE #1
- 1754 BEEP: GOSUB 3000: T6=62: GOTO 1776
- 1756 FOR K1=N6+1 TO N5: INPUT #1,B(6,K1): NEXT K1
- 1758 CLOSE #1: OPEN "O",1,J$
- 1760 PRINT #1,1938+N6
- 1762 FOR K1=N6+2 TO N5: PRINT #1,USING "##.######";B(6,K1): NEXT K1
- 1763 CLOSE #1: GOSUB 9860
- 1764 IF LEN(E$(I1))>44 THEN 1766
- 1765 E$(I1)=E$(I1)+", updated Nov 1,"+STR$(1951+N4)
- 1766 PRINT " Suggested title of assumptions, set";STR$(I1);", is"
- 1768 PRINT " ";E$(I1)
- 1770 PRINT " Press RETURN to accept, or enter new title"
- 1772 PRINT " > ";: E$(0)=FNGETSTRN$(65): GOSUB 9850
- 1774 IF LEN(E$(0))>0 THEN E$(I1)=E$(0)
- 1776 NEXT I1: IF T6>0 THEN 1800
- 1777 OPEN "O",1,"TITLES.DAT"
- 1778 PRINT " Writing titles of assumptions to TITLES.DAT"
- 1780 FOR I1=1 TO 4: PRINT #1,CHR$(34);E$(I1);CHR$(34): NEXT I1
- 1782 CLOSE #1
- 1800 REM Print exit menu
- 1805 CLS: GOSUB 2000: PRINT " ";: GOSUB 9870
- 1810 PRINT STRING$(29," ");"Program selection";STRING$(29," ")
- 1815 GOSUB 2000: PRINT: PRINT
- 1820 GOSUB 9860: PRINT " Enter desired program:"
- 1825 PRINT " 0 to calculate a PIA"
- 1826 PRINT " 1 to review or change configuration"
- 1830 PRINT " 2 to store social security office address"
- 1835 PRINT " > ";: K8=VAL(FNGETSTRN$(1))
- 1840 IF K8<0 OR K8>2 THEN BEEP: GOTO 1820
- 1845 CLS: GOSUB 9850: ON K8+1 GOTO 1900,1860,1850
- 1850 PRINT " Loading address program; please wait..."
- 1855 CHAIN "ADDRESS"
- 1860 PRINT " Loading configuration program; please wait..."
- 1865 CHAIN "CONFIG"
- 1900 PRINT " Loading PIA data-input program; please wait..."
- 1905 CHAIN "PIAIN"
- 2000 REM Subroutine to draw 75 hyphens
- 2005 GOSUB 9860: PRINT " ";STRING$(75,"-"): RETURN
- 2100 REM Subroutine to convert response to one-letter uppercase
- 2105 I4=ASC(C$): IF I4>96 THEN C$=CHR$(I4-32) ELSE C$=CHR$(I4)
- 2110 RETURN
- 2200 REM Subroutine to prepare screen for data
- 2205 K4=G1: GOSUB 9820: CLS: I3=1: LOCATE 2,1
- 2215 FOR K1=1 TO 20: FOR K2=1 TO 3: GOSUB 9870: IF I3=1 THEN 2230
- 2226 PRINT STRING$(13," ");: GOSUB 9860: GOTO 2245
- 2230 PRINT " ";K4;" ";
- 2235 IF K1 MOD 2=1 THEN GOSUB 9860 ELSE GOSUB 9863
- 2245 PRINT STRING$(11," ");
- 2255 K4=K4+20: IF K4<=G2 THEN I3=1 ELSE I3=0
- 2260 NEXT K2: PRINT
- 2280 K4=K4-59: IF K4<=G2 THEN I3=1 ELSE I3=0
- 2285 NEXT K1: GOSUB 2600: RETURN
- 2300 REM Subroutine to request new value
- 2305 GOSUB 9860: LOCATE 23,10
- 2310 PRINT "Please enter new value"
- 2320 U7=((G2-G1+1) MOD 20)+1: U6=(G2-G1+2-U7)/20
- 2325 U6=1+24*U6: LOCATE U7+1,U6: GOSUB 9870: PRINT " ";G2+1;" ";
- 2330 IF U7 MOD 2=0 THEN GOSUB 9864 ELSE GOSUB 9860
- 2335 PRINT ">";STRING$(10," ");
- 2337 LOCATE U7+1,U6+14: B(0,G2+1-1936)=VAL(FNWGETSTRN$(9))
- 2340 LOCATE U7+1,U6+13: PRINT USING " ######.## ";B(0,G2+1-1936)
- 2345 RETURN
- 2600 REM Subroutine to blank message window
- 2605 GOSUB 9860
- 2610 LOCATE 23,8: PRINT STRING$(65," ");
- 2615 LOCATE 24,8: PRINT STRING$(65," ");
- 2620 RETURN
- 2700 REM Subroutine to put amounts on screen
- 2705 U6=14: U7=1: FOR K1=G1 TO G2
- 2715 IF U7 MOD 2=1 THEN GOSUB 9860 ELSE GOSUB 9864
- 2720 LOCATE U7+1,U6: PRINT USING " ######.## ";B(0,K1-1936)
- 2725 U7=U7+1: IF U7>20 THEN U6=U6+24: U7=1
- 2730 NEXT K1: RETURN
- 2800 REM Subroutine to print continue message
- 2805 GOSUB 9860: LOCATE 23,10
- 2810 PRINT "Press RETURN to continue";
- 2815 C$=INKEY$: IF LEN(C$)<1 THEN 2815
- 2820 IF ASC(C$)<>13 THEN BEEP: GOTO 2815
- 2825 RETURN
- 2900 REM Subroutine to put benefit increases on screen
- 2905 U6=14: U7=1: FOR K1=G1 TO G2
- 2915 IF U7 MOD 2=1 THEN GOSUB 9860 ELSE GOSUB 9864
- 2920 LOCATE U7+1,U6: PRINT USING " #####.## ";B(0,K1-1950)
- 2925 U7=U7+1: IF U7>20 THEN U6=U6+24: U7=1
- 2930 NEXT K1: RETURN
- 3000 REM Subroutine to print RETURN message
- 3005 GOSUB 9860: PRINT
- 3010 PRINT " Press RETURN to continue";
- 3015 C$=INKEY$: IF LEN(C$)<1 THEN 3015
- 3020 IF ASC(C$)<>13 THEN BEEP: GOTO 3015
- 3025 RETURN
- 9800 REM 1-line subroutines
- 9813 REM For Macintosh, $INCLUDE "COLOR.MAC"
- 9814 REM $INCLUDE: 'COLOR.BAS'
- 9900 GOSUB 9860: CLS: END
- 9999 REM OLDAWBI.BAS - 10/30/87 - 03:45 PM
-