GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles/ |
Upload File : |
blockSize = 5 maxSize = blockSize dim asEntered$(maxSize) index = 0 newName$="flagToInitializeWhileStatement" while newName$<>"" input "Enter a name: ";newName$ if newName$<>"" then index = index+1 if index > maxSize then call redimArray asEntered$,maxSize,blockSize asEntered$(index)=newName$ end if wend 'copy the array into the arrays to sort dim sortedByFirst$(index) for i = 1 to index sortedByFirst$(i) = asEntered$(i) next i dim sortedByLast$(index) for i = 1 to index firstName$ = word$(asEntered$(i),1) lastName$ = word$(asEntered$(i),2) sortedByLast$(i) = lastName$+", "+firstName$ next i ' Sort by first name change = 1 while change = 1 change = 0 for i = 1 to index-1 if sortedByFirst$(i) > sortedByFirst$(i+1) then temp$ = sortedByFirst$(i) sortedByFirst$(i) = sortedByFirst$(i+1) sortedByFirst$(i+1) = temp$ change = 1 end if next i wend ' Sort by last name change = 1 while change = 1 change = 0 for i = 1 to index-1 if sortedByLast$(i) > sortedByLast$(i+1) then temp$ = sortedByLast$(i) sortedByLast$(i) = sortedByLast$(i+1) sortedByLast$(i+1) = temp$ change = 1 end if next i wend for i = 1 to index print i,asEntered$(i) next i print for i = 1 to index print i,sortedByFirst$(i) next i print for i = 1 to index print i,sortedByLast$(i) next i sub redimArray byref stringArray$,byref currentSize,addSize 'copy array to temp dim temp$(currentSize) for i = 1 to currentSize temp$(i) = stringArray$(i) next i 'redim array newSize = currentSize+addSize redim stringArray$(newSize) 'copy back from temp for i = 1 to currentSize stringArray$(i) = temp$(i) next i currentSize = newSize end sub 'firstName$ = word$(newName$,1) 'lastName$ = word$(newName$,2) 'print "firstName$=";firstName$;" lastName$=";lastName$