C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 16, Problem 16.13E
Program Plan Intro

Program Plan:

  • Include necessary header files.
  • Declare boolPalindromeTester(string s); function header which will accept a string and return a bool value.
  • Start main() function:
  • Declare string variable “ a ” and bool variable “ c ”.
  • Input string in “ a ”.
  • Call “PalindromeTester” function with argument as “ a ”.
  • Check if return of function is true, then display “string is palindrome” else display “String not a palindrome”.
  • Return and exit main function.
  • Define function boolPalindromeTester(string s).
  • Use transforn function to convert string s to lowercase.
  • Declare two strings “a” and “b”.
  • Use copy_if function to remove said punctuations and copy in new string “a”.
  • Make “b” same as “a”.
  • Use reverse() function on “b” to get reverse of string in “b”.
  • Make check bool value true.
  • Run loop from first string to end, comparing characters of both “a” and “b”. If mismatch is found return false.
  • If loop is fully executed, return true.
  • Blurred answer
    Students have asked these similar questions
    I need help to solve the following case, thank you
    hi I would like to get help to resolve the following case
    Could you help me to know  features of the following concepts: - defragmenting. - dynamic disk. - hardware RAID
    Knowledge Booster
    Background pattern image
    Similar questions
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    C++ Programming: From Problem Analysis to Program...
    Computer Science
    ISBN:9781337102087
    Author:D. S. Malik
    Publisher:Cengage Learning
    Text book image
    C++ for Engineers and Scientists
    Computer Science
    ISBN:9781133187844
    Author:Bronson, Gary J.
    Publisher:Course Technology Ptr
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,