Make one that determines if a word/sentence is a palindrome. A palindrome is a word that is the same forwards and backwards, such as racecar or Some men interpret nine memos. And make it ignore punctuation for an added challenge. Here is what a sample run would look like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Please enter a string:
> ABCDEFGHGFEDCBA
"ABCDEFGHGFEDCBA" IS a palindrome
Please enter a string:
> The quick brown fox
"The quick brown fox" is NOT palindrome
Please enter a string:
> Cigar? Toss it in a can. It is so tragic.
"Cigar? Toss it in a can. It is so tragic." IS a palindrome
This isn't really much to do with string manipulation but if you're a beginner and haven't already made a program that reads from and writes to a text file, it's very useful to be able to do that.
Write a program that asks for a user first name and last name separately.
The program must then store the users full name inside a single string and out put it to the string.
i.e.
Input:
John
Smith
Output:
John Smith
★ Modify the program so that it then replaces every a, e, i , o, u w/ the letter z.
i.e.
John Smith -> Jzhn Smzth
★★ Modify the Program so that it reverses the users name
i.e.
John Smith -> htimS nhoJ