if you can com up with any better code for my loan calculator you can send it to me at [email protected] i use gwbasic thanks for all that have giving me code already!!!!!
110 REM * Programer: Justen Durr Date: XXX XX,XXXX 120 REM * 130 REM * Discription: Loan calculator and to have fun 140 REM * Vars: I= intrest MOI= month intrest YRI= year intrest 150 REM * nummo= no. months numyear= no.years loanamt= loan amount 160 REM * denomon= denominator d1= first donminator 170 REM * 180 REM * to turn the music off just go line 9061 190 REM * 200 REM * 210 REM * 220 REM * 230 REM *****************************************************************
400 gosub 1000 : 'Initalize 410 gosub 1100 : 'Menu start up 420 while (a>0): 'looking for 0 430 gosub 1600 : 'print menu 440 gosub 1700 : 'menu selection 450 wend : 'wend will it end
999 END
1000 'Initalization 1010 P$ = "Please Hit Any Key to Continue" 1020 A = 10 1030 CNT = 0 1035 nme$ = "JUSTEN" 1040 RETURN
1100 'list menu optione 1101 DIM MNU$ (6) 1110 MNU$(1) = " Calculate the Loan" 1120 MNU$(2) = " Display Amorazation Table" 1130 MNU$(3) = " Print Amorazation Table (not working)" 1140 MNU$(4) = " Compare Two Loans" 1150 MNU$(5) = " Start New Loan" 1160 mnu$(6) = " Turkey Break or Blue Screen of DEATH!" 1170 MNU$(0) = " EXIT" 1180 RETURN
1600 'Print Menu out 1610 Color 7,1 :CLS 1620 locate 7,20 : PRINT "Loan MASTER 1000)" 1630 x= 8 1640 for j = 1 to 6 1650 y= x + j 1660 LOCATE y,8: PRINT USING " # - \ \ "; J,mnu$(J) 1670 next j 1680 LOCATE 16,8: PRINT USING " # - \ \ "; 0,mnu$(0) 1690 return
1700 'get meny with (using on) 1720 GOSUB 3200 1740 IF (A>0) THEN ON A GOSUB 4000, 5000, 1600, 6000, 4000, 9000, 9000, 9000, 9000, 9000 1790 RETURN
2000 'Math par 2010 YRI = I/100 2020 MOI = yri/12 2030 NUMMO= NUMYEAR * 12 2040 NUMERATOR = MOI * LOANAMT 2050 D1 = 1/(1+moi) 2060 DENOM = (1-D1^NUMMO) 2070 PAYMENT = NUMERATOR/DENOM : TOTPAY = PAYMENT * NUMMO : TOTINT = TOTPAY - LOANAMT 2099 RETURN
3100 'inkey doo 3110 LOCATE 23,10: PRINT P$ 3120 Q$ = INKEY$ 3130 IF Q$ = "" THEN GOTO 3120 3140 RETURN
3200 'get number 3210 ' 3220 GOSUB 3100 : 3230 A$ = Q$ 3240 IF (A$ < CHR$(48) OR A$ > CHR$(54) ) THEN gosub 9000 ELSE GOSUB 3300 3250 RETURN
3300 'make a number 3310 ' 3320 A = VAL(A$) 3330 RETURN
4000 'Calc the Loan 4002 color 7,1 : cls 4001 'locate 1,1 : Print "Our user Frindly menu" 4005 locate 3,4 : Print "How much do you want?" 4015 locate 7,4 : Print "Term of loan?" 4030 locate 11,4 : Print "Rate?" 4040 locate 5,4 : Input LOANAMT 4050 locate 9,4 : Input NUMYEAR 4060 locate 12,4 : Input I 4070 gosub 2000 4080 gosub 4500 4490 return
4500 'Print loan Calc 4510 cls 4520 locate 6,9 : Print "Welcome to Justen's Loan Sharking" 4530 locate 7,9 : print "Your business is appreciated (or we break you legs) 4540 locate 9,9 : Print Using "A loan of $###,###.## for a term of ## years,"; LOANAMT; NUMYEAR 4550 locate 10,9 : Print Using "at our generous interest rate of ##.#% will require a"; YRI 4560 locate 11,9 : Print Using "payment of $##,###.## per month. (AND DON'T BE LATE!)"; PAYMENT 4570 locate 12,5 : Print Using "Total Payout: $###,###.## Total Interest paid: $###,###.##"; TOTPAY ; TOTINT 4580 locate 15,19 : Print "We thank you for your business." 4590 gosub 3100 4600 return
5000 'Amorzation Tables 5005 REMBAL = LOANAMT: cls 5010 GOSUB 5500 :' Print Header 5020 FOR J = 1 TO NUMMO 5030 IF ((J MOD 13) = 0) THEN GOSUB 5700 ELSE GOSUB 5100 5040 PRINT USING AM$ ; J; IMODUE; PRIPAID; REMBAL 5050 NEXT J 5060 FINPAY = PRIPAID + IMODUE 5070 LOCATE 18,3: PRINT USING "Final Payment ###.## comparid to ###.##"; FINPAY;PAYMENT 5080 LOCATE 21,10: PRINT "Prepaird by",NME$ 5090 gosub 3100 5160 RETURN
5100 'Amoization Table Calc 5110 IMODUE = REMBAL * MOI 5120 PRIPAID = PAYMENT - IMODUE 5130 REMBAL = REMBAL - PRIPAID 5190 RETURN
5500 'Amorization Headers 5510 PRINT USING " Amount Loan:$###,###.## Monthly Payment:$##,###.##" ; loanamount;PAYMENT 5520 PRINT USING " Term of Loan: ## years Interest Rate of Loan ##.#%"; NUMYEAR;I 5530 PRINT USING " Total Payout: $###,###.## Total Interest Paid:$###,###.##"; TOTPAY; TOTINT 5540 PRINT "" 5550 PRINT "Payment Interest Principle Remaining" 5560 PRINT "Number Due Paid Balance" 5570 AM$ = " ## ###.## ###.## ###,###.##" 5590 RETURN
5700 'screen stop 5710 GOSUB 3100 5720 CLS 5730 GOSUB 5500 5740 GOSUB 5100 5790 RETURN
6000 'compare loan bonus 6010 CLS 6020 LOCATE 8,5 : PRINT "Please enter loan amont " 6030 LOCATE 8,40: PRINT "_________" 6040 LOCATE 8,60: PRINT "__________" 6050 LOCATE 9,5 : PRINT "Please enter interest (1.2%) " 6060 LOCATE 9,40: PRINT "________" 6070 LOCATE 9,60: PRINT "________" 6080 LOCATE 10,5 : PRINT "Plesase enter term length (years)" 6090 LOCATE 10,40: PRINT "________" 6100 LOCATE 10,60: PRINT "________" 6110 LOCATE 8,40: INPUT loanamt 6120 LOCATE 9,40: INPUT I 6130 LOCATE 10,40: INPUT NUMYEAR 6140 GOSUB 2000
6150 LOCATE 15, 8 : PRINT USING "Loan 1 $ ###,###.##"; LOANAMT 6160 LOCATE 16, 8 : PRINT USING "Term (months) #,###"; NUMMO 6170 LOCATE 17, 8 : PRINT USING "Payment $ ##,###.##"; PAYMENT 6180 LOCATE 18, 8 : PRINT USING "Total Payment $ ###,###.##"; TOTPAY 6210 LOCATE 8,60: INPUT Loanamt 6220 LOCATE 9,60: INPUT I 6230 LOCATE 10,60: INPUT NUMYEAR 6240 GOSUB 2000
6250 LOCATE 15, 40 : PRINT USING "Loan 2 $###,###.##"; LOANAMT 6260 LOCATE 16, 40 : PRINT USING "Term (months) #,###"; NUMMO 6270 LOCATE 17, 40 : PRINT USING "Payment $##,###.##"; PAYMENT 6280 LOCATE 18, 40 : PRINT USING "Total Payment $ ###,###.##"; TOTPAY 6285 GOSUB 3100 6290 return
8100 'Ammoization Table Calc 8110 IMODUE = REMBAL * MOI 8120 PRIPAID = PAYMENT - IMODUE 8130 REMBAL = REMBAL - PRIPAID 8190 RETURN
8500 'Print Ammorization Header 8510 PRINT USING " Amount Loan:$###,###.## Monthly Payment:$##,###.##" ; loanamt;PAYMENT 8520 PRINT USING " Term of Loan: ## years Interest Rate of Loan ##.#%"; NUMYEAR;I 8530 PRINT USING " Total Payout: $###,###.## Total Interest Paid:$###,###.##"; TOTPAY; TOTINT 8540 PRINT "" 8550 PRINT "Payment Interest Principle Remaining" 8560 PRINT "Number Due Paid Balance" 8570 AM$ = " ## ###.## ###.## ###,###.##" 8590 RETURN
8700 'screen stop 8710 GOSUB 3100 8720 CLS 8730 GOSUB 8500 8740 GOSUB 8100 8790 RETURN
9000 ' ************ bad entery messed up ************* 9010 CLS 9020 color 7,1 9030 locate 6,30 : color 1,7 : PRINT" Loan System Failure" : color 7,1 9035 locate 7,20 : print"A fatal exception 0e has occurred at what ever" 9040 locate 8,20 : PRINT"Bill gates like people like you!" 9050 locate 10,20 : Print "* Press any key to terminate the currrent application." 9060 'the music 9061 locate 11,20 : print "* Press CTRL+ALT+DLE again and again and again to restart your computer ": print"you will lose all unsaved work AKA. if you are already here it is too late!" 9065 LET FIRST$ = "O2 L2 C L4 G O2 L6 FED O3 L3 C O2 L4 G L6 FED O3 L3 C O2 L4 G L6 FEF L4 D O1 " 9066 PLAY FIRST$ 9070 end 9080 RETURN 9999 'color 7= white color 7,1 blue scree of death
here is what i have
Hosted by www.Geocities.ws

1