Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with listing names under Alphabetical order
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kho




PostPosted: Sun Nov 23, 2003 3:42 pm   Post subject: help with listing names under Alphabetical order

code:
var name: string
var count : int := 0
put "-- Enter a series of names --"
loop
put "Name ",count + 1, ": "..
get name
    count := count + 1
if name = "*" then
exit
end if
end loop
put name

THeres the code. I've tried for hours, how do I put it in Alpha :(
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Sun Nov 23, 2003 3:46 pm   Post subject: (No subject)

read my tutorials on arrays and sortting and for your program, i suggest using a flexible array, also in my tutorial
kho




PostPosted: Sun Nov 23, 2003 3:51 pm   Post subject: (No subject)

I wasn't tought arrays yet, can u show me another way
Andy




PostPosted: Sun Nov 23, 2003 4:04 pm   Post subject: (No subject)

do you noe how many names there are gonna be?
kho




PostPosted: Sun Nov 23, 2003 4:07 pm   Post subject: (No subject)

In the question it says series, so I guess unlimited lol
Tony




PostPosted: Sun Nov 23, 2003 6:16 pm   Post subject: (No subject)

well then you need to create an unlimited number of variables Laughing
code:

var name1:string
var name2:string
...
var nameInfinity:string


good luck Laughing Just read a tutorial on arrays. I've wrote one and dodge is saying he wrote another one...
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Andy




PostPosted: Sun Nov 23, 2003 6:48 pm   Post subject: (No subject)

mine is better than urs tony :p
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: