Palindrone
Author |
Message |
Jessica359
![](http://compsci.ca/v3/uploads/user_avatars/7434636574818b0e9b7877.gif)
|
Posted: 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 Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
gitoxa
![](http://compsci.ca/v3/uploads/user_avatars/125344263047f801d546bcb.jpg)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
spicypolvoron
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
CodeMonkey2000
|
Posted: 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
|
|
|
|
|
|
![](images/spacer.gif) |
Jessica359
![](http://compsci.ca/v3/uploads/user_avatars/7434636574818b0e9b7877.gif)
|
Posted: Fri May 30, 2008 7:25 am Post subject: RE:Palindrone |
|
|
ok thank you ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
|
|