-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasicQuote.bas
314 lines (311 loc) · 8.18 KB
/
BasicQuote.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
25 GOTO 40
30 RESUME
40 PRINT "NOMONC.1.0"
70 GOTO 90
75 BELL = 768
80 TEXT : HOME
90 HOME
100 PRINT "1- QUOTE"
110 PRINT "2- CHANGE RATES"
120 PRINT "3- EXIT"
130 PRINT "WHICH "
135 GET QW: PRINT QW: IF QW < 1 OR QW > 3 THEN CALL -958: GOTO 130
140 IF QW = 2 THEN GOSUB 2738
150 IF QW = 3 THEN END
160 TEXT
170 REM ######################
180 REM ######################
190 REM ######################
200 REM #### ###
210 REM ### MAIN BODY OF ###
220 REM ### ###
230 REM ### PROGRAM ###
240 REM #### ###
250 REM ######################
260 REM ######################
270 REM ######################
280 CARRIER$ = "MASS MUTUAL"
290 REM INFORMATION
300 HOME
310 INPUT "COMPANY NAME "; COMPANY$
320 PRINT "CARRIER NAME "; CARRIER$
330 VTAB 2: HTAB 13
340 INPUT C1$
350 VTAB 2: HTAB 14
360 IF C1$ = "" THEN PRINT CARRIER$: GOTO 380
370 CARRIER$ = C1$
380 DTE$ = STR$ ( PEEK (1017)) + "/" + STR$ ( PEEK (1010)) + "/" + STR$ ( PEEK (1016))
390 PRINT "WDI: ";: GET WDI$: PRINT WDI$
480 PRINT "DENTAL ";: GET DENTAL$: PRINT DENTAL
410 HOME
420 INPUT "NUMBER OF EMPLOYEES "; NUMBER
430 HOME
435 DIM S1$(NUMBER)
440 DIM NAME$(NUMBER)
447 DIM A1$(NUMBER)
450 DIM AGE$(NUMBER)
460 DIM SEX$(NUMBER)
470 DIM S$(NUMBER)
480 DIM RTE$(NUMBER)
486 DIM L1$(NUMBER)
489 DIM W1$(NUMBER)
490 DIM DRTE$(NUMBER)
500 DIM WRTE$(NUMBER)
510 DIM DTRTE$(NUMBER)
520 DIM TT(NUMBER)
530 FOR COUNTER = 1 TO NUMBER
540 REM NAME
550 VTAB 2: HTAB 6: PRINT "---------------"
560 VTAB 1: INPUT "NAME "; S$
570 FL = 20: CE= 3: GOSUB 63977
580 NAME$(COUNTER) = S$
620 PRINT
630 REM SEX
640 PRINT "SEX (M/F) ";: GET S$
650 IF S$ = "H" THEN PRINT "MALE"
660 IF S$ = "F" THEN PRINT "FEMALE"
670 IF S$ <> "M" AND S$ > "F" THEN 640
675 S1$(COUNTER) = " " + S$ + " "
680 PRINT : PRINT
690 REM AGE
700 PRINT "1) -29"
710 PRINT "2) 30-34"
720 PRINT "3) 35-39"
730 PRINT "4) 40-44"
740 PRINT "5) 45-49"
750 PRINT "6) 54-54"
760 PRINT "7) 55-59"
770 PRINT "8) 68-64"
780 PRINT "9) 65-69"
790 PRINT "AGE ";: GET S$: PRINT S$
800 A1$(COUNTER) = " " + S$ + " "
810 PRINT
820 REM EMPLOYEE STATUS
830 PRINT "E)MPLOYEE ONLY"
840 PRINT "D)EPENDENTS"
850 PRINT "L)IFE ONLY"
860 PRINT "WHICH ";: GET ST$(COUNTER)
865 A1 = VAL(MID$ (A1$(COUNTER),2,1))
870 IF ST$(COUNTER) <> "E" AND ST$(COUNTER) <> "D" AND ST$(COUNTER) <> "L" THEN CALL N: GOTO 860
880 IF ST$(COUNTER) = "E" THEN PRINT "EMPLOYEE ONLY"
890 IF ST$(COUNTER) = "D" THEN PRINT "DEPENDENTS"
900 IF ST$(COUNTER) = "L" THEN PRINT "LIFE ONLY"
910 PRINT : PRINT : HTAB (10): PRINT "IS THIS CORRECT ";: GET RI$
920 IF RI$ = "N" THEN HOME : GOTO 550
930 HOME
940 REM GOES TO NEXT EMPLOYEE
950 IF COUNTER = NUMBER THEN 970
960 NEXT COUNTER
970 PRINT CHR$(4) "OPEN RATE"
976 S1$ = S1$(COUNTER)
980 PRINT CHR$(4) "READ RATE"
990 FOR X = 1 TO 9: INPUT R1(X): NEXT X
1000 FOR X = 1 TO 9: INPUT R2(X): NEXT X
1010 FOR I = 1 TO 9: INPUT R3(X): NEXT X
1020 INPUT R4(1)
1030 INPUT R4(2)
1040 PRINT CHR$(4) "CLOSE RATE"
1045 IF ST$(COUNTER) = "L" THEN 1110
1050 IF S1$ = " M " THEN RTE = R1(A1)
1060 IF S1$ = " F " THEN RTE = R2(A1)
1070 RTE$ = STR$(RTE)
1080 TT(COUNTER) = TT(COUNTER) + RTE
1085 RTE$ = STR$(RTE)
1090 GOSUB 63967
1095 E2 = E2 + RTE
1100 E1$(COUNTER) = RTE$
1105 A = 1
1110 IF ST$(COUNTER) <> "D" THEN RTE$ = " ": GOSUB 63967: D1$(COUNTER) = RTE$: GOTO 1190
1120 RTE = R3(A1)
1130 RTE$ = STR$(RTE)
1140 TT(COUNTER) = TT(COUNTER) + RTE
1150 D2 = D2 + RTE
1160 GOSUB 63967
1170 D1(COUNTER) = RTE
1180 A = 2
1190 IF ST$(COUNTER) <> "L" THEN 1460
1200 R5(1) = 4.1
1210 R5(2) = 4.4
1220 R5(3) = 5.2
1230 R5(4) = 6.9
1240 R5(5) = 9.6
1250 R5(6) = 14.2
1260 R5(7) = 21.1
1270 R5(8) = 30.7
1280 R5(9) = 45.8
1290 R6(1) = 3.2
1300 R6(2) = 3.4
1310 R6(3) = 3.9
1320 R6(4) = 4.9
1330 R6(5) = 6.5
1340 R6(6) = 9.3
1350 R6(7) = 13.4
1360 R6(8) = 19.1
1370 R6(9) = 28.2
1380 IF S1$(COUNTER) = " M " THEN RTE = R5(A1)
1390 IF SI$(COUNTER) = " F " THEN RTE = R6(A1)
1400 RTE$ = STR$(RTE)
1410 TT(COUNTER) = TT(COUNTER) + RTE
1420 E2 = E2 + RTE
1430 GOSUB 63967
1440 E1$(COUNTER) = RTE$
1450 A = 1
1460 IF DENTAL$ <> "Y" THEN RTE$ = " ": GOSUB 63967: D3$(COUNTER) = RTE$: GOTO 1530
1470 RTE = R4(A)
1480 RTE$ = STR$(RTE)
1490 TT(COUNTER) = TT(COUNTER) + RTE
1500 D4 = D4 + RTE
1510 GOSUB 63967
1520 D3$(COUNTER) = RTE$
1530 IF WDI$ <> "Y" THEN RTE$ = " ": GOSUB 63967: W1$(COUNTER) = RTE$: GOTO 1790
1540 R7(1) = 3.60
1550 R7(2) = 4.2
1560 R7(3) = 4.9
1570 R7(4) = 5.9
1580 R7(5) = 7.2
1590 R7(6) = 8.5
1600 R7(7) = 10.7
1610 R7(8) = 13.7
1620 R7(9) = 17.9
1630 R8(1) = 7.6
1640 R8(2) = 7.7
1650 R8(3) = 7.8
1660 RB(4) = 8.8
1670 R8(5) = 10.8
1680 R8(6) = 12.6
1690 RB(7) = 16.00
1700 RB(8) = 20.4
1710 RB(9) = 26.7
1720 IF SI$(COUNTER) = " M " THEN RTE = R7(A1)
1730 IF S1$(COUNTER) = " F " THEN RTE = R8(A1)
1740 RTE$ = STR$(RTE)
1750 TT(COUNTER) = TT(COUNTER) + RTE
1760 W2 = N2 + RTE
1770 GOSUB 63967
1780 W1$(COUNTER) = RTE$
1790 T2 = T2 + TT(COUNTER)
1800 RTE$ = STR$(TT(COUNTER))
1810 GOSUB 63967
1820 TT$(COUNTER) = RTE$
1830 NEXT COUNTER
1840 RTE$ = STR$(E2)
1850 GOSUB 63967
1860 E2$ = RTE$
1870 RTE$ = STR$(D2)
1875 IF D2 = 0 THEN RTE$ = " "
1880 GOSUB 63967
1890 D2$ = RTE$
1900 RTE$ = STR$(W2)
1905 IF W2 = 0 THEN RTE$ = " "
1910 GOSUB 63967
1920 W2$ = RTE$
1930 RTE$ = STR$(D4)
1935 IF D4 = 0 THEN RTE$ = " "
1940 GOSUB 63967
1950 D4$ = RTE$
2070 INPUT "ADMINISTRATION CHARGE "; AD$
2080 REM
2090 REM ######################
2100 REM ######################
2110 REM ### ###
2120 REM ## PRINT ROUTINE ##
2130 REM ### ###
2140 REM ######################
2150 REM ######################
2160 REM
2170 PR# 1: REM TURN PRINTER ON
2180 PRINT CHR$(146)
2190 PRINT TAB( 10);"PROPOSAL FOR: "; CHR$(14);COMAPANY$
2200 PRINT TAB( 10);"BY "; CHR$(27); "E";CARRIER$
2210 PRINT CHR$(27);"F"; TAB( 11);"DATE "; CHR$(27);"E";DTE$; CHR$(27);"F"; CHR$(15)
2220 PRINT TAB( 5); "NAME";
2230 PRINT SPC( 21); "SEX";
2240 PRINT SPC( 5); "AGE";
2250 PRINT SPC( 5); "EMP COST";
2260 PRINT SPC( 5); "DEP COST";
2270 PRINT SPC( 5); " WDI ";
2280 PRINT SPC( 5); " DNT ";
2290 PRINT SPC( 8); CHR$(14); "TOTAL"
2300 FOR COUNTER = 1 TO 132: PRINT "-";: NEXT COUNTER
2310 PRINT
2320 FOR COUNTER = 1 TO NUMBER
2340 PRINT COUNTER; TAB(4); NAHE$(COUNTER);
2350 PRINT SPC( 5);S1$(COUNTER);
2360 PRINT SPC( 5);A1$(COUNTER);
2370 PRINT SPC( 5);E1$(COUNTER);
2380 PRINT SPC( 6);D1$(COUNTER);
2390 PRINT SPC( 7);W1$(COUNTER);
2400 PRINT SPC( 7);D3$(COUNTER);
2429 PRINT SPC( 5);TT$(COUNTER)
2480 NEXT COUNTER
2485 PRINT "ADMINISTRATION"; SPC( 30); "$"; AD$
2490 FOR X = 1 TO 132: PRINT "=";: NEXT X
2500 PRINT
2650 PRINT "TOTAL"; SPC(35);E2$;
2660 PRINT SPC( 13);D2$;
2670 PRINT SPC( 6);W2$;
2680 PRINT SPC( 6);D4$;
2690 PRINT SPC( 6);T2$;
2700 END
2710 REM
2720 POKE 32,9
2730 PRINT TAB( 10);"***CHANGE RATES***"
2740 FOR X = 1 TO 9
2750 PRINT "MALE EMPLOYEE GROUP "; X:: INPUT " "; R1(X)
2760 NEXT X
2770 FOR X = 1 TO 9
2780 PRINT "FEMALE EMPLOYEE GROUP "; X;: INPUT " "; R2(X)
2790 NEXT X
2800 FOR X = 1 TO 9
2810 PRINT "DEPENDENT GROUP ";X;: INPUT " "; R3(X)
2820 NEXT X
2830 INPUT "DENTAL FOR LIFE + EMPLOYEE"; R4(1)
2840 INPUT "DENTAL FOR DEPENDENT "; R4(2)
2850 PRINT CHR$(4) "OPEN RATE"
2960 PRINT CHR$(4) "WRITERATE"
2870 FOR I = 1 TO 9
2888 PRINT R1(X)
2890 NEXT X
2900 FOR X = 1 TO 9
2910 PRINT R2(X)
2920 NEXT X
2930 FOR I = 1 TO 9
2940 PRINT R3(X)
2950 NEXT I
2960 PRINT R4(1)
2970 PRINT R4(2)
2980 PRINT CHR$(4) "CLOSE RATE"
2990 RETURN
63967 REM STRING LENGTH - RATES
63968 IF RIGHT$(RTE$,1)= "." THEN RTE$ = RTE$ + "00"
63969 IF MID$(RTE$, LEN(RTE$) - 1, 1) = "." THEN RTE$ = RTE$ + "0"
63979 R1$ = "$"
63971 FOR I = 1 TO (6 - LEN(RTE$))
63972 R1$ = R1$ + " "
63973 NEXT I
63974 R1$ = R1$ + RTE$
63975 RTE$ = R1$
63976 RETURN
63977 REM STRING LENGTH - REST
63978 TS = TS - LEN(S$)
63979 IF CE = 1 THEN C = 0.5
63988 IF CE = 2 THEN BS = 0: ES = TS: GOTO 63984
63981 IF CE = 3 THEN FOR I = 1 TO FL: S$ = S$ + " ": NEXT I: S$ = LEFT$(S$,FL)
63982 BS = INT((TS - (TSC * C)) * 10 ^ 0 + .5) / INT (10 ^ 0 + .5)
63983 ES = TS - BS
63984 IF BS < 0 THEN BS = 0
63985 IF ES < 0 THEN ES = 0
63986 IF BS = 0 THEN 63990
63987 FOR X = 1 TO BS
63988 BS$ = BS$ + " "
63989 NEXT X
63990 IF ES = 0 THEN 63994
63991 FOR X = 1 TO ES
63992 ES$ = ES$ + " "
63993 NEXT X
63994 R2$ = BS$ + S$ + ES$
63995 S$= R2$
63996 RETURN
63997 REM ROUND
63998 N = INT(N * 10 ^ DE + .5) / INT(10 ^ DE + .5)
63999 RETURN