Big problem on C++

Discussion in 'C++' started by [LinkZ], Sep 16, 2007.

  1. [LinkZ]

    [LinkZ] New Member

    Joined:
    Sep 16, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Write a program that uses a stack to determine if a string is a palindrome (i.e, the string is spelled identically backward and forward). The program should ignore spaces and punctuation.

    Sample output:
    Enter a line of text:
    able was i ere i saw elba
    “able was i ere i saw elba” is a palindrome

    Enter a line of text:
    this is not a palindrome
    “this is not a palindrome” is not a palindrome

    Help please guys =(
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    Be sure and read the "Before you make a query" thread. We don't actually write code on demand for people, we help with the code THEY write and have trouble with.

    What you want to do is think how you would go about testing for a palindrome, whether you use a stack or some other method. Express it in your native language. Write down the steps. This would be called "pseudo-code". Once you've gotten that far, translate it into C++ as best you can.

    If you do post code, for help, be sure and use code tags to preserve the indentation. You'll find that in the "Before you make a query" thread, too, along with some material emphasizing how important it is that you give complete, lucid information regarding any problems you have.
     
  3. ME_ME

    ME_ME New Member

    Joined:
    Sep 21, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Wahh... this question is for our Assignment... PLs give us the solution.
    Onegai!!! ^0^
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice