C++   How to Program (Early Objects Version)
C++ How to Program (Early Objects Version)
10th Edition
ISBN: 9780134448824
Author: Paul Deitel; Harvey M. Deitel
Publisher: Pearson Education (US)
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
    4. |z + 5 - 5i| = 7
    14. dz, C: |z❘ C: |z❘ = 0.6 ze² - 2iz H
    14. dz, C: |z❘ C: |z❘ = 0.6 ze² - 2iz H
    Knowledge Booster
    Background pattern image
    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
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    C++ for Engineers and Scientists
    Computer Science
    ISBN:9781133187844
    Author:Bronson, Gary J.
    Publisher:Course Technology Ptr
    Text book image
    Systems Architecture
    Computer Science
    ISBN:9781305080195
    Author:Stephen D. Burd
    Publisher:Cengage Learning
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
    Text book image
    COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
    Computer Science
    ISBN:9780357392676
    Author:FREUND, Steven
    Publisher:CENGAGE L