5 CLEAR 1200
10 PRINT "ALPHABETIZE"
20 PRINT
30 PRINT "(TO END PROGRAM ENTER 0)"
40 PRINT "NUMBER OF ITEMS";
50 INPUT N
59 REM - END PROGRAM?
60 IF N=0 THEN 270
69 REM - LIMIT ARRAY TO MAXIMUM NUMBER OF ITEMS TO BE ENTERED IN ONE RUN
70 DIM A$(25)
80 FOR I=1 TO N
90 PRINT "ITEM";I;
100 INPUT A$(I)
110 NEXT I
119 REM - LOOP TO ALPHABETIZE DATA
120 FOR I=1 TO N
130 FOR J=1 TO N-I
138 REM - THE REPLACEMENT TECHNIQUE IN LINES 140 TO 180 CAUSES
139 REM - LOWER VALUES TO FLOAT OR BUBBLE TO THE TOP
140 A$=A$(J)
150 B$=A$(J+1)
160 IF A$<B$ THEN 190
170 A$(J)=B$
180 A$(J+1)=A$
190 NEXT J
200 NEXT I
210 PRINT
220 FOR I=1 TO N
229 REM - PRINT ALPHABETIZED ITEMS
230 PRINT A$(I)
240 NEXT I
250 PRINT
260 GOTO 40
270 END
