Write a C++ Program to check whether a string is a palindrome or not. A palindrome is a word, verse, or sentence (such as " I ere I saw Elba") that reads the same backward or forward.   In this task, the inserted string should consist of letters only (A to Z and a to z). In case of an invalid character is inserted, the output will be the phrase "Wrong entry". If the iserted string is palindrome, the output will be the word "Palindrome", else it will be "NOT Palindrome". The inserted string is case insensitive.   IMPORTANT NOTE Do not add any cout statements except for the final answer as specified above. Do not add "Enter a number", "the number of digits is" or any similar prompts. Also note that the automatic grader is case-sensitive; so "palindrome" is wrong but "Palindrome" is right. Do not add any unnecessary spaces inside the strings of cout statements " ". You may add any libraries needed. I/O Program Input: A string consists of letters only Program Output: A phrase that shows that the entry is wrong "Wrong entry" , the string is palindrome "Palindrome", or not "NOT Palindrome". Sample Testcase 0: Input:   car   Output:   NOT Palindrome   Sample Testcase 1: Input:   Road25   Output:   Wrong entry   Sample Testcase 2: Input:   BiB Output:   Palindrome   Sample Testcase 3: Input:   Civic   Output:   Palindrome

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Write a C++ Program to check whether a string is a palindrome or not. A palindrome is a word, verse, or sentence (such as " I ere I saw Elba") that reads the same backward or forward.

 

In this task, the inserted string should consist of letters only (A to Z and a to z). In case of an invalid character is inserted, the output will be the phrase "Wrong entry". If the iserted string is palindrome, the output will be the word "Palindrome", else it will be "NOT Palindrome". The inserted string is case insensitive.

 

IMPORTANT NOTE

Do not add any cout statements except for the final answer as specified above.

Do not add "Enter a number", "the number of digits is" or any similar prompts.

Also note that the automatic grader is case-sensitive; so "palindrome" is wrong but "Palindrome" is right.

Do not add any unnecessary spaces inside the strings of cout statements " ".

You may add any libraries needed.

I/O

Program Input:

A string consists of letters only

Program Output:

A phrase that shows that the entry is wrong "Wrong entry" , the string is palindrome "Palindrome", or not "NOT Palindrome".

Sample Testcase 0:

Input:

 

car

 

Output:

 

NOT Palindrome

 

Sample Testcase 1:

Input:

 

Road25

 

Output:

 

Wrong entry

 

Sample Testcase 2:

Input:

 

BiB

Output:

 

Palindrome

 

Sample Testcase 3:

Input:

 

Civic

 

Output:

 

Palindrome

#include <iostream>
2
#include <cstdlib>
4
using namespace std;
6.
int main() {
7
8.
9.
return 0;
10
11 }
3.
Transcribed Image Text:#include <iostream> 2 #include <cstdlib> 4 using namespace std; 6. int main() { 7 8. 9. return 0; 10 11 } 3.
Expert Solution
steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning