1000 rem micheal harve mccabe 1010 rem statistics on the computer 1020 rem assignment #10 - Sort the Data set into ascending order 1030 rem November 5, 1981 1040 rem 1050 rem Sorts the data set into ascending order using the bubble sort 1060 rem 1070 dim d(500) : rem reserve storage space for 500 data values 1080 let c = 0 : rem count of data points 1090 input "Enter the filename to read: ";f$ 1100 print 1110 on error goto 1190 1120 open f$ for input as #1 1130 while not (eof(1)) 1140 input #1,v 1150 let c = c+1 1160 let d(c) = v 1170 print c,v 1180 wend 1190 close #1 1200 for x = 1 to c-1 1210 for y = x+1 to c 1220 if d(x) <= d(y) then 1260 1230 let t = d(x) 1240 let d(x) = d(y) 1250 let d(y) = t 1260 next y 1270 next x 1280 input "Enter the filename to write: ";f$ 1290 open f$ for output as #2 1300 for i = 1 to c 1310 print #2,d(i) 1320 next i 1330 close #2 1340 print "end program." 1350 end