Options

# Help program in basic!

Registered User regular
edited October 2007
You guys will probably think this is super simple and wussy stuff but i cant figure this out.. I thought I had it but it just doesnt work. I have to be able to sort the planets by the order they were input, alphabetic order and position in solar system. When i run it to sort the whole array wont change just the numbers of orbit position or planet names.
500 '************************Begin Main Program********************
510 WHILE (FLG$= "Y") 520 FLG$ = "n"
530 CNT = CNT + 1
540 CLS
550 LOCATE 5,10 : INPUT "Enter planet name"; AR$(CNT,1) 560 LOCATE 6,10 : INPUT "Enter orbit position"; AR(CNT,1) 570 LOCATE 7,10 : INPUT "Enter number of moons"; AR(CNT,2) 580 LOCATE 8,10 : INPUT "What is the atmosphere type"; AR$(CNT,2)
590 LOCATE 9,10 : INPUT "Is the planet inner ring or outer"; AR$(CNT,3) 595 LOCATE 10,10 : INPUT "What is the equatorial radius in kilometers"; AR(CNT,3) 600 '**********************DO AGAIN ROUTINE********************** 610 LOCATE 22,5: INPUT "Would you like to do again? Y/N"; FLG$
620 IF (FLG$= "y") THEN FLG$ = "Y"
630 IF (FLG$= "") THEN FLG$ = "Y"
650 WEND
710 CLS
711 '************************PRINT*******************************
715 locate 5,10: print "How would you like the data?"
716 locate 6,10: print "A. by order in which it was input"
717 locate 7,10: print "B. by alphabetic order of planet name"
718 locate 8,10: print "C. by position in solar system"
719 locate 9,10: input "Please choose A, B, or C"; D$720 if (D$ = "a") then D$= "A" 721 if (D$ = "b") then D$= "B" 722 if (D$ = "c") then D$= "C" 730 if (D$ = "A") then goto 760 else if (D$= "B") then goto 840 else if (D$ = "C") goto 900
760 cls
765 '*******************************************************
770 LOCATE 3,1: PRINT HD1$780 locate 4,1: print hd2$
790 FOR J = 1 TO CNT
800 PRINT USING T$; AR$(J,1), AR(J,1), AR(J,2), AR$(J,2), AR$(J,3), AR(J,3)
810 NEXT J
820 '*******************************************************
840 for j = 1 to cnt
845 for k = 1 to cnt
850 if ar$(j,1) < ar$(k,1) then ar$(k,1) = ar$(j,1)
860 next k
870 next j
880 LOCATE 3,1: PRINT HD1$881 locate 4,1: print hd2$
882 FOR J = 1 TO CNT
883 PRINT USING T$; AR$(J,1), AR(J,1), AR(J,2), AR$(J,2), AR$(J,3), AR(J,3)
884 NEXT J
890 '*******************************************************
900 for j = 1 to cnt
910 for k = 1 to cnt
920 if ar(j,1) < ar(k,1) then ar(k,1) = ar(j,1)
930 next k
940 next j
950 LOCATE 3,1: PRINT HD1$960 locate 4,1: print hd2$
970 FOR J = 1 TO CNT
980 PRINT USING T$; AR$(J,1), AR(J,1), AR(J,2), AR$(J,2), AR$(J,3), AR(J,3)
990 NEXT J
999 END