C++ How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (10th Edition)
Question
Book Icon
Chapter 16, Problem 16.12E
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).
  • Pass string “ s ” into “ a ”.
  • Reverse the string “ a ”.
  • Make check bool value true.
  • Run loop from first string to end, comparing characters of both “s” and “a”. If mismatch is found return false.
  • If loop is fully executed, return true.
  • Program Description:

    Program to check if string is palindrome or not using reverse algorithm.

    Blurred answer
    Students have asked these similar questions
    Find the error in each of the following programing ?
    What’s the output of the following programs?
    What is wrong in the following function?