1 REM FQUOQ
5 CLEAR 1000
10 CLS:PRINT TAB(10);"INVENTORY THEORY-FIXED QUANTITY EOQ"
15 PRINT TAB(13);"WITH QUANTITY PRICE BREAKS":PRINT
20 PRINT"THIS PROGRAM INVOLVES AN INVENTORY PROBLEM FOR WHICH IT IS 
25 PRINT"ASSUMED THAT THE FOLLOWING CONDITIONS HOLD:
30 PRINT"  THERE IS A CONSTANT ORDERING COST PER ORDER
35 PRINT"  INVENTORY HOLDING COST IS CONSTANT PER UNIT HELD
40 PRINT"  NO BACKORDERS ARE PERMITTED (STOCKOUTS NOT ALLOWED)
50 PRINT"  DEMAND FOR THE ITEMS ARE CONSTANT AND UNIFORM THROUGH TIME
55 PRINT"  THERE ARE QUANTITY PRICE BREAKS.
60 PRINT"THE QUANTITY PRICE BREAKS ARE OF THE FIXED-LOT DISCOUNT TYPE.
65 PRINT"I.E. DISCOUNTS (IN PRICE/UNIT) ARE OFFERED FOR THE PURCHASE
70 PRINT"OF CERTAIN FIXED LOT SIZES. THERE IS ALSO AN ORDINARY PRICE/
75 PRINT"UNIT IF THAT PARTICULAR LOT SIZE IS NOT OFFERED.
90 INPUT"PRESS ENTER TO BEGIN";Z9$
100 CLS
110 INPUT"ENTER ANNUAL DEMAND(IN UNITS)      ";D
120 INPUT"ENTER REORDER COST(PER ORDER)      ";S
140 INPUT"ENTER HOLDING COST(PER UNIT/YEAR   ";C
150 INPUT"ENTER NORMAL PURCHASE PRICE/ITEM   ";P
160 PRINT:INPUT"HOW MANY DIFFERENT LOT SIZES ARE OFFERED";NL
165 NL = INT(NL): IF NL < 1 OR NL > 10 THEN 160
170 FOR I=1 TO NL
180 PRINT"FOR LOT SIZE #";I
185 INPUT"     LOT SIZE QUANTITY      ";QQ(I)
190 INPUT"     PRICE/UNIT             ";PP(I)
200 PRINT
210 NEXT I
220 QQ(0)= SQR(2*D*S/C):PP(0)=P
230 FOR I=0 TO NL:TC(I)=D*PP(I)+D/QQ(I)*S+QQ(I)/2*C:NEXT
300 F$(1)=" #     SIZE      PRICE/UNIT       TOTAL COST"
310 F$(2)=" ##   ######.#    ######.##       #########.##"
350 CLS
360 PRINT"# REFERS TO THAT LOT SIZE #. LOT SIZE #0 REFERS TO THE 
370 PRINT"LOT SIZE WITHOUT CONSIDERING THE QUANTITY PRICE BREAKS"
380 PRINT
390 PRINT F$(1)
400 FOR I=0 TO NL
410 PRINT USING F$(2);I,QQ(I),PP(I),TC(I)
420 NEXT
430 M=1E20:FOR I=0 TO NL
440 IF TC(I)<M THEN M=TC(I):IM=I
450 NEXT
460 PRINT:PRINT"MINIMUM COST IS";TC(IM);"ATTAINED BY CHOOSING LOT SIZE";QQ(IM)
490 PRINT:INPUT"PRESS ENTER FOR MORE";Z9$
492 IF Z9$ = "-1" THEN END
495 GOTO 100
