Computer Science Canada

help with letter changer

Author:  v3n0m [ Tue Nov 15, 2005 10:06 am ]
Post subject:  help with letter changer

hey im new to turing i started it last week and am learning it on my own but my compsci teacher gave me a booklet of questions to try to do by making certain programs and i cant figure out how to do this one quesiton you have to input a letter thats a capital and output it as a small cased letter any ideas?

Author:  ZeroPaladn [ Tue Nov 15, 2005 10:09 am ]
Post subject: 

look up Str.Lower and Str.Upper, or just type these and hit F9, it will give you examples and hints on how to use it. In fact, if there is something you dont understand, just type it out and hit F9, it should shed some light on the situation.

Author:  v3n0m [ Tue Nov 15, 2005 10:17 am ]
Post subject:  help with letter changer

this turing program im using is rather old and doesnt have str.upper and str.lower any other ideas?

Author:  v3n0m [ Tue Nov 15, 2005 10:35 am ]
Post subject:  help with letter changer

nevermind i figured it out it went like this

var bah: string
var X : int
var value :int
put "enter a single character "
get bah
X:=ord(bah)
put "ASCII value of ", bah, " is ", X
X:=X+32
put "the lower case letter is ", chr(X)

Author:  Tony [ Tue Nov 15, 2005 12:49 pm ]
Post subject: 

what if the user enters a lower case letter or a number?

Author:  MysticVegeta [ Tue Nov 15, 2005 7:55 pm ]
Post subject: 

heheheheh
code:
strintok
to the rescue then!

Author:  Tony [ Tue Nov 15, 2005 10:53 pm ]
Post subject: 

he's not using strint() though.

the proper answer was to check if the letter is in the proper value range first Wink

Author:  MysticVegeta [ Wed Nov 16, 2005 7:53 pm ]
Post subject: 

hmm what i meant was
code:
if ~strintok(bah) then
%continue
else
put bah
end if

Author:  jacklarry [ Wed Nov 16, 2005 8:04 pm ]
Post subject: 

you could use stinkok. thats probably the easiest and best way to do it.

Author:  Mr. T [ Wed Nov 16, 2005 11:06 pm ]
Post subject:  Alex's Opinion

jacklarry wrote:
you could use stinkok.

LMAO. Doh!

Author:  ZeroPaladn [ Thu Nov 17, 2005 9:48 am ]
Post subject: 

provided venom knows how to use strintok Rolling Eyes .


: