Question
Hello, I need the code in C++ for the problem given below. A requirement is to NOT use global variables, so please refrain from doing
Hello, I need the code in C++ for the problem given below. A requirement is to NOT use global variables, so please refrain from doing so. I created a program for this problem already using an implementation of the char[] array, but my teacher gave me no credit. She wants me to check to see if the word is a palindrome using the str.substr() method to iterate through the letters in the word, I cannot use the char[] function at all. Also, you MUST use the given function header: bool is_palindrome(string str), I cannot add any other integers within the paranthesis. She wants all of the operations do be done within ONE function, just the given one and a main function. Thank you very much for your time, this is the third time I've asked for help on this xc
E5.22 Write a recursive function bool is palindrome(string str) that returns true if str is a palindrome, that is, a word that is the same when reversed. Examples of palindrome are "deed", "rotor", or "aibohphobia". Hint: A word is a palindrome if the first and last letters match and the remainder is also a palindromeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started