Palindrome program in c++.?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bigtd08
    New Member
    • Mar 2008
    • 1

    Palindrome program in c++.?

    help writing this palindrome program for my c++ class.
    HERE WHAT THE CODE SHOULD BE LIKE.
    Write a program that takes a line of input from the keyboard and check to see if that line is a palindrome. Your program should ignore blanks, punctuation, and lettercase

    Your program should output what the user entered as well as the reversed line.

    Sample output:

    Please enter a phrase, and I will tell you if it is a palindrome.
    >> Madam I'm Adam
    You entered Madam I'm Adam
    True. This IS a palindrome, the reversed string is madamimadam
    Would you like to enter another phrase (y/n)
    >> y
    Please enter a phrase, and I will tell you if it is a palindrome.
    >> Kayak
    You entered Kayak
    True. This IS a palindrome, the reversed string is kayak
    Would you like to enter another phrase (y/n)
    >> y
    Please enter a phrase, and I will tell you if it is a palindrome.
    >> Last Stall
    You entered Last Stall
    False. This is NOT a palindrome, the reversed string is llatstsal.

    Thanks in Advance :)
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    Here is the answer to your question.

    Comment

    • Simonius
      New Member
      • Feb 2008
      • 47

      #3
      What's the problem?
      Some advice
      -check how you can remove spaces and turn everything lowercase
      -then think about what a palindrome is
      -think about how your "string" works.

      Comment

      Working...