Computer Science Canada

How do I put variables in alphabetical order?

Author:  liquidfirekan [ 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

Author:  DemonWasp [ 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


: