100 REM TYPED BY CONNIE FOSTER ,CORRECTED BY C.FOSTER ,PROG BY O.E.DIAL
110 REM ALL REM STATEMENTS CAN BE CHANGED TO ALLOW USE OF TWO TERMINALS
120 REM SEE ARTICLE IN PERSONAL COMPUTING MAY/JUNE 77
130 Q=27:V$="###.#":W$="$$#####,":U$="###"
140 DIMD(18),E$(Q),V(Q),F(Q)
150 PRINTTAB(19)"RECURSIVE BUDGETING MODEL":PRINT:PRINTTAB(28)"* * *"
160 DATASALARY/WAGES,OTHER INCOME,FED INC TAX,STATE & LOCAL TAX
170 DATASOCIAL SECURITY,UNEMPLOYMENT INS,HEALTH INS
180 DATALIFE INS,CONTRIBUTIONS,OTHER DEDUCTIONS
190 DATARENT/MORTGAGE,LIFE INS,HEALTH INS,HOUSE INS
200 DATAAUTO INS,CAR PAYMENTS,LOAN PAYMENTS,TRASH REMOVAL
210 DATAOTHER FIXED EXP
220 DATAFOOD/BEVERAGES,CLOTHING,DRY CLEANING,BARBER/BEAUTY
230 DATAHOME MAINT,HOME HEAT'G FUEL,WATER,ELECTRICITY, TELEPHONE
240 DATAGAS/OIL,AUTO MAINT,FARES/TOLLS/PARKING,DENTIST
250 DATAPHYSICIAN,DRUGS/SUNDRIES,SCHOOL EXPENSE,FAMILY ALLOWANCE
260 DATACLUBS/LODGES,THEATER/SPORTS,RESTAURANTS
270 DATAOTHER ENT'MENT,MAG'S/BOOKS/PAPERS,SITTERS,CHILD CARE
280 DATAVACATION SAVING,OTHER SAVINGS,CONTRIBUTIONS,OTHER EXPENSES
290 PRINT:PRINT"SELECT YOUR BUDGETING PERIOD BY NUMBER. LATER ON IT WILL"
300 PRINT"BE EXTENDED TO ONE YEAR.":PRINT
310 PRINTTAB(3)"1-WEEKLY"TAB(15)"2-BIWEEKLY"TAB(30)"3-SEMIMONTHLY";
320 PRINTTAB(45)"4-MONTHLY":PRINT
330 INPUTP:IFP>4THENPRINT"TRY AGAIN":GOTO290
340 IFP=1THENP=52ELSEIFP=2THENP=26ELSEIFP=3THENP=24ELSEIFP=4THENP=12
350 PRINT:PRINT"ALRIGHT,FIRST LET'S LOOK AT INCOME FOR THE PERIOD.":PRINT
360 READA$:PRINTA$;" $";:INPUTD(0):READA$:PRINTA$;" $";:INPUTD(1)
370 TI=D(0)+D(1):PRINT
380 PRINT:PRINT"OK,NOW LET'S LOOK AT PAYCHECK DEDUCTIONS.":PRINT
390 FORJ=2TO9:READA$:PRINTA$;:INPUT" $";D(J):TD=TD+D(J):NEXTJ:PRINT 
400 PRINT"OK,NOW LET'S LOOK AT FIXED EXPENSES.":PRINT
410 FORJ=10TO18:READA$:PRINTA$;:INPUT" $";D(J):TF=TF+D(J):NEXTJ
420 DF=TD+TF:SI=TI-DF:S=64
430 PRINT:PRINT"OK,AT THIS TIME OUR TABLE LOOKS LIKE THIS:":PRINT
440 REM
450 GOSUB1900:PRINT:PRINTTAB(19);
460 PRINT"RECURSIVE BUDGETING MODEL":PRINT:PRINTTAB(27)"* * *":PRINT
470 GOSUB1900
480 PRINT:PRINTTAB(20)"SPENDABLE INCOME SUMMARY":PRINT
490 GOSUB1890:PRINTTAB(3)"ACCOUNT"TAB(42)"PERIOD"TAB(57)"ANNUAL"
500 GOSUB1890:PRINT"TOTAL INCOME" TAB(40);:PRINTUSINGW$;TI;:PRINTTAB(55)
510 PRINTUSINGW$;TI*P:PRINT:PRINTTAB(3)"PAYCHECK DEDUCTIONS"TAB(25);
520 PRINTUSINGW$;TD*(-1):PRINT
530 PRINTTAB(3)"FIXED EXPENSES"TAB(25);:PRINTUSINGW$;TF*(-1);
540 PRINTTAB(40);:PRINTUSINGW$;DF*(-1);:PRINTTAB(55);
550 PRINTUSINGW$;DF*(-1)*P
560 PRINTTAB(41)"-------"TAB(55)"--------":PRINT"SPENDABLE INCOME";
570 PRINTTAB(40);:PRINTUSINGW$;SI;:PRINTTAB(55);:PRINTUSINGW$;SI*P
580 PRINTTAB(41)"======="TAB(55)"========":PRINT:
590 GOSUB1900:PRINT: PRINT
600 REM
610 GOSUB1910:RO=0
620 PRINT:PRINT "OK,NOW FOR THE FIRST ROUND OF VARIABLE EXPENSE. DON'T"
630 PRINT"PINCH YOURSELF IN YOUR ESTIMATES (WITHIN REASON). LET THE"
640 PRINT"COMPUTER HELP YOU REFINE YOUR BUDGET LATER ON.":PRINT
650 FORJ=0TOQ:READE$(J) :PRINTE$(J);:INPUT" $";V(J):VT=VT+V(J):NEXTJ
660 RESTORE:PRINT:PRINT
670 PRINT"YOUR BUDGET FOR THE FIRST ROUND TOTALLED $"VT". THIS"
680 PRINT"COMPARES TO SPENDABLE INCOME OF $"SI". WE HAVE"
690 PRINT"PRORATED THE DIFFERENCE, $"SI-VT",OVER ALL VARIABLE EXPENSE"
700 PRINT"ACCOUNTS.":PRINT
710 GOSUB1910:FORJ=0TOQ:V(J)=INT(V(J)/VT*SI):NEXTJ:VT=SI:PRINT
720 PRINT"NOW WE BEGIN THE BUDGET REFINEMENT PHASE. MAKE AS MANY"
730 PRINT"PASSES AS YOU LIKE. AS YOU REVIEW EACH ACCOUNT,DECIDE"
740 PRINT"WHETHER TO FREEZE IT OR TO LEAVE IT FOR ANOTHER PASS.":PRINT
750 PRINT"HINT: DON'T BE IN A HURRY TO FREEZE AN ACCOUNT.":PRINT
760 PRINT"YOUR TASK IS FINISHED WHEN ALL ACCOUNTS ARE FROZEN.":PRINT
770 GOSUB1910
780 FORJ=0TOQ:PRINT:IFV(J)=0THEN980
790 PRINTE$(J);" $";V(J):INPUT"CHANGE ('Y' OR 'N')";A$
800 IFA$="N"THEN840ELSEIFA$="Y"THEN820ELSEIFA$<>"Y"THEN790
810 GOTO790
820 INPUT"REVISED AMOUNT $";A:IFA<V(J)THEN840
830 GOSUB1930
840 INPUT"FREEZE ('Y' OR 'N')";B$:PRINT
850 IFA$="Y"ANDB$="Y"THEN900
860 IFA$="Y"ANDB$="N"THEN940
870 IFA$="N"ANDB$="N"THEN980
880 VT=VT-V(J):FT=FT+V(J):SWAPF(J),V(J):V(J)=0:PRINT
890 PRINT"OK,THE ACCOUNT HAS BEEN FROZEN AT $"F(J)".":GOTO980
900 VT=VT-A:FT=FT+A:SWAPA,F(J):V(J)=0
910 FORK=OTOQ:V(K)=INT(V(K)*(SI-FT)/VT):NEXTK:VT=SI-FT
920 PRINT"OK,THE ACCOUNT HAS BEEN FROZEN AT $"F(J)",AND THE DIFFERENCE"
930 PRINT"PRORATED OVER REMAINING ACCOUNTS.":PRINT:GOTO980
940 VT=VT-V(J)+A:V(J)=A
950 FORK=0TOQ:V(K)=INT(V(K)*(SI-FT)/VT):NEXTK:VT=SI-FT
960 PRINT"OK,THE VALUE HAS BEEN CHANGED TO $"A", AND THE DIFFERENCE"
970 PRINT"PRORATED OVER REMAINING ACCOUNTS.":PRINT
980 NEXTJ:PRINT:R=0:FORJ=0TOQ:IFV(J)=0THENR=R+1:NEXTJ
990 IFR<=QTHEN1010
1000 FORJ=OTOQ:F(J)=INT(F(J)/FT*SI):VT=0:FT=SI:GOTO1380
1010 PRINT"NOW LET'S RECAP VARIABLE EXPENSES BEFORE GOING ON TO THE"
1020 PRINT"NEXT ROUND.":PRINT:RO=RO+1:V1=0:F1=0
1030 FORJ=0TOQ:V(J)=INT(V(J)/VT*(SI-FT)):NEXTJ:VT=SI-FT
1040 REM
1050 PRINTTAB(7)"INTERIM SUMMARY OF VARIABLE EXPENSES";
1060 PRINT":   NO."RO
1070 GOSUB1890:PRINTTAB(3)"ACCOUNTS"TAB(28)"NUMBER"TAB(37)"PERCENT";
1080 PRINTTAB(48)"AMOUNT"TAB(56)"PERCENT"
1090 GOSUB1890:FORJ=0TOQ:IFV(J)+F(J)=0THEN1110
1100 IFV(J)THENV1=V1+1ELSEF1=F1+1
1110 NEXTJ
1120 PRINT"VARIABLE EXPENSES"TAB(29);:PRINTUSINGU$;V1;:PRINTTAB(39);
1130 PRINTUSINGV$;V1/(V1+F1)*100;:PRINTTAB(46);:PRINTUSINGW$;VT;
1140 PRINTTAB(58);:PRINTUSINGV$;VT/TI*100:PRINT
1150 PRINT"FROZEN EXPENSES"TAB(29);:PRINTUSINGU$;F1;:PRINTTAB(39);
1160 PRINTUSINGV$;F1/(V1+F1)*100;:PRINTTAB(46);
1170 PRINTUSINGW$;FT;:PRINTTAB(58);:PRINTUSINGV$;FT/TI*100
1180 PRINTTAB(28)"-------"TAB(48)"--------"
1190 PRINTTAB(3)"TOTALS"TAB(29);:PRINTUSINGU$;F1+V1;:PRINTTAB(46);
1200 PRINTUSINGW$;VT+FT:PRINTTAB(28)"======="TAB(48)"========":PRINT
1210 GOSUB1900:PRINT:PRINT
1220 GOSUB1230:GOTO1270
1230 PRINTTAB(8)"INTERIM STATUS OF VARIABLE EXPENSES  NO."RO
1240 GOSUB1890:PRINTTAB(3)"ACCOUNT"TAB(30)"VARIABLE"TAB(43)"FROZEN";
1250 PRINTTAB(54)"PERCENT"
1260 GOSUB1890:PRINT
1270 FORJ=0TOQ:IFV(J)+F(J)=0THEN1330ELSEPRINTE$(J);:R2=R2+1
1280 IFF(J)THEN1300ELSEPRINTTAB(29):PRINTUSINGW$;V(J);:PRINTTAB(55);
1290 PRINTUSINGV$;V(J)/TI*100:GOTO1320
1300 PRINTTAB(40);:PRINTUSINGW$;F(J);:PRINTTAB(55);
1310 PRINTUSINGV$;F(J)/TI*100
1320 IFINT(R2/5)=R2/5THENPRINT
1330 NEXTJ:PRINT:R2=0
1340 GOSUB1900:PRINT
1350 REM
1360 PRINT:PRINT "NOW WE MAKE ANOTHER PASS THROUGH VARIABLE EXPENSES.":PRINT
1370 GOTO770
1380 PRINT"PLEASE INPUT THE REQUESTED INFORMATION BEFORE WE PROVIDE A"
1390 PRINT"FINAL DETAIL OF YOUR BUDGET.":PRINT
1400 PRINTTAB(18)"* USE NO COMMAS NOR COLONS *":PRINT
1410 INPUT"NAME";A$:INPUT"BUDGET YEAR";A
1420 B=LEN(A$):B=16-B/2
1430 REM
1440 GOSUB1920
1450 GOSUB1900:PRINT
1460 PRINTTAB(B)"* THE "A$" FAMILY BUDGET FOR"A"*":PRINT
1470 GOSUB1900:PRINT
1480 PRINTTAB(6)"ACCOUNT"TAB(20)""TAB(26)"INCOME"TAB(38)":";
1490 PRINTTAB(44)"EXPENSE"TAB(56)":PERCENT"
1500 PRINTTAB(20)":-----------------:-----------------: TOTAL"
1510 PRINTTAB(20)": PERIOD : ANNUAL : PERIOD : ANNUAL : INCOME"
1520 PRINT"--------------------:--------:--------:--------:--------:------"
1530 X$=":$$#####,:$$#####,:        :        : ###.#"
1540 Y$=":        :        :$$#####,:$$#####,: ###.#"
1550 GOTO1570
1560 PRINT":        :        :        :        :":RETURN
1570 PRINT"INCOME"TAB(20);:PRINTUSINGX$;TI;TI*P;TI/TI*100
1580 PRINT"------"TAB(20);
1590 GOSUB1560
1600 READA$:PRINTA$TAB(20);:PRINTUSINGX$;D(0);D(0)*P;D(0)/TI*100
1610 READA$:PRINTA$TAB(20);:PRINTUSINGX$;D(1);D(1)*P;D(1)/TI*100
1620 PRINTTAB(20);
1630 GOSUB1560
1640 PRINT"PAYCHECK DEDUCT'S"TAB(20);
1650 PRINTUSINGY$;TD;TD*P;TD/TI*100
1660 PRINT"-----------------"TAB(20);
1670 GOSUB1560
1680 FORJ=2TO9:READA$:IFD(J)=0THEN1700ELSEPRINTA$TAB(20);
1690 PRINTUSINGY$;D(J);D(J)*P;D(J)/TI*100
1700 NEXTJ:PRINTTAB(20);
1710 GOSUB1560
1720 PRINT"FIXED EXPENSES"TAB(20);
1730 PRINTUSINGY$;TF;TF*P;TF/TI*100
1740 PRINT"--------------"TAB(20);
1750 GOSUB1560
1760 FORJ=10TO18:READA$:IFD(J)=0THEN1780ELSEPRINTA$TAB(20);
1770 PRINTUSINGY$;D(J);D(J)*P;D(J)/TI*100
1780 NEXTJ:PRINTTAB(20);
1790 GOSUB1560
1800 PRINT"VARIABLE EXPENSE"TAB(20);
1810 PRINTUSINGY$;FT;FT*P;FT/TI*100
1820 PRINT"----------------"TAB(20);
1830 GOSUB1560
1840 FORJ=0TOQ:IFF(J)=0THEN1860ELSEPRINTE$(J)TAB(20);
1850 PRINTUSINGY$;F(J);F(J)*P;F(J)/TI*100
1860 NEXTJ:PRINT
1870 GOSUB1900:PRINT
1880 GOSUB1900:PRINT:GOTO1980
1890 FORL=1TOS:PRINT"-";:NEXTL:PRINT:RETURN
1900 FORL=1TOS:PRINT"=";:NEXTL:PRINT:RETURN
1910 PRINT"PRESS 'Y' TO CONTINUE":PRINT:INPUTA$:PRINT:RETURN
1920 FORL=1TO10:PRINT;:NEXTL:RETURN
1930 IFA<=V(J)THEN1970
1940 IFA<=VTTHEN1970
1950 PRINT"* YOU HAVE EXCEEDED YOUR BALANCE OF SPENDABLE INCOME BY $"A-SI;
1960 PRINT" *":INPUT"REVISED AMOUNT $";A:PRINT
1970 RETURN
1980 RESTORE:READA$:READA$:PRINT:PRINT:S=95
1990 PRINTTAB(21)"* EXPENSE BAR CHART *"
2000 PRINTTAB(20)"PERCENT OF TATAL INCOME":PRINT
2010 GOSUB1890:PRINT
2020 GOSUB2140:PRINT
2030 FORJ=2TO18:READA$:IFD(J)=0THEN2060
2040 A=INT(D(J)/TI*300):PRINTA$;
2050 GOSUB2170
2060 NEXTJ
2070 FORJ=0TOQ:IFF(J)=0THEN2100
2080 A=INT(F(J)/TI*300):PRINTE$(J);
2090 GOSUB2170
2100 NEXTJ:PRINT
2110 GOSUB2140:PRINT:PRINT
2120 GOSUB1900:PRINT:PRINT:STOP
2130 REM
2140 PRINTTAB(20)"  -  -  -  -  5  -  -  -  - 10  -  -  -  - 15  -  -  -  ";
2150 PRINT"- 20  -  -  -  - 25":RETURN
2160 RETURN
2170 IFA<1THENPRINTTAB(20)"]":GOTO2200
2180 IFA<2THENPRINTTAB(20)"]]":GOTO2200
2190 PRINTTAB(20);:FORK=1TOA:PRINT"]";:NEXTK:PRINT
2200 RETURN
2210 REM
2220 REM
2230 STOP
2240 REM
2250 REM
:GOTO2200
2190 PRINTTAB(20);:FORK=