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

Username:   Password: 
 RegisterRegister   
 How do I put variables in alphabetical order?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
liquidfirekan




PostPosted: Sat Apr 14, 2012 10:16 pm   Post subject: How do I put variables in alphabetical order?

Write a program that asks for a word and then for a second word. The two words should then be printed in alphabetical order. Be sure to check that your program works correctly.

I know how to get the variable

var word1: string
get word1

var word2:string
get word2

but no idea how to put in alphabetical order. Please help
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Sat Apr 14, 2012 11:02 pm   Post subject: RE:How do I put variables in alphabetical order?

In Turing, you can use the > and < comparison operators on strings. That should be enough to let you figure out which one comes first. See also: http://compsci.ca/holtsoft/doc/string.html
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  [ 2 Posts ]
Jump to:   


Style:  
Search: