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

Username:   Password: 
 RegisterRegister   
 help with letter changer
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
v3n0m




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
ZeroPaladn




PostPosted: Tue Nov 15, 2005 10:09 am   Post subject: (No 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.
v3n0m




PostPosted: 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?
v3n0m




PostPosted: 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)
Tony




PostPosted: Tue Nov 15, 2005 12:49 pm   Post subject: (No subject)

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




PostPosted: Tue Nov 15, 2005 7:55 pm   Post subject: (No subject)

heheheheh
code:
strintok
to the rescue then!
Tony




PostPosted: Tue Nov 15, 2005 10:53 pm   Post subject: (No subject)

he's not using strint() though.

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




PostPosted: Wed Nov 16, 2005 7:53 pm   Post subject: (No subject)

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




PostPosted: Wed Nov 16, 2005 8:04 pm   Post subject: (No subject)

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




PostPosted: Wed Nov 16, 2005 11:06 pm   Post subject: Alex's Opinion

jacklarry wrote:
you could use stinkok.

LMAO. Doh!
ZeroPaladn




PostPosted: Thu Nov 17, 2005 9:48 am   Post subject: (No subject)

provided venom knows how to use strintok Rolling Eyes .
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  [ 11 Posts ]
Jump to:   


Style:  
Search: