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

Username:   Password: 
 RegisterRegister   
 Palindrone
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jessica359




PostPosted: Thu May 29, 2008 9:11 am   Post subject: Palindrone

Hey,
I'm not sure what function to use for this?

A Palindrome application which allows the user to input a list of words or phrases from a data file. Display each word as entered and reversed. If the word is the same forwards and backwards tell the user it is a palindrome, otherwise tell the user it is not a palindrome.

So like if the user puts in "racecar" it will say that it is a palindrone but if they but in "cat" then it will say its not a palindrone.

thnxs Smile
Sponsor
Sponsor
Sponsor
sponsor
gitoxa




PostPosted: Thu May 29, 2008 2:54 pm   Post subject: RE:Palindrone

There is no function to do this for you, you need to use string manipulation.
spicypolvoron




PostPosted: Thu May 29, 2008 7:48 pm   Post subject: RE:Palindrone

I had this assignment before, what I did was put the word backwards using for decreasing, and use if statement if the backward word is equal to the word.
CodeMonkey2000




PostPosted: Thu May 29, 2008 9:07 pm   Post subject: RE:Palindrone

Check out string manipulation in the Turing Walkthrough. Remember, strings are just an array of characters, and can be compared as such.
code:
var myString : string := "Hello World"
put myString
for x : 1 .. length (myString)
    put myString (x)
end for
Jessica359




PostPosted: Fri May 30, 2008 7:25 am   Post subject: RE:Palindrone

ok thank you Smile
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  [ 5 Posts ]
Jump to:   


Style:  
Search: