In C++ do not add any extra libraries A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of text is a palindrome. The program reads a line, then outputs whether the input is a palindrome or not. Ex: If the input is: senile felines! the output is: Yes, "senile felines!" is a palindrome. Ex: If the input is: rotostor the output is: No, "rotostor" is not a palindrome. Ignore punctuation and spacing. Assume all alphabetic characters will be lowercase. Special case: A one-character string is a palindrome

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
Question

In C++ do not add any extra libraries

A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of text is a palindrome. The program reads a line, then outputs whether the input is a palindrome or not.

Ex: If the input is:

senile felines!

the output is:

Yes, "senile felines!" is a palindrome.

Ex: If the input is:

rotostor

the output is:

No, "rotostor" is not a palindrome.

Ignore punctuation and spacing. Assume all alphabetic characters will be lowercase.

Special case: A one-character string is a palindrome

A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of
text is a palindrome. The program reads a line, then outputs whether the input is a palindrome or not.
Ex: If the input is:
senile felines!
the output is:
Yes, "senile felines!" is a palindrome.
Ex: If the input is:
rotostor
the output is:
No, "rotostor" is not a palindrome.
Ignore punctuation and spacing. Assume all alphabetic characters will be lowercase.
Special case: A one-character string is a palindrome.
Transcribed Image Text:A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of text is a palindrome. The program reads a line, then outputs whether the input is a palindrome or not. Ex: If the input is: senile felines! the output is: Yes, "senile felines!" is a palindrome. Ex: If the input is: rotostor the output is: No, "rotostor" is not a palindrome. Ignore punctuation and spacing. Assume all alphabetic characters will be lowercase. Special case: A one-character string is a palindrome.
main.cpp
1 #include <iostream>
2 #include <deque>
3
4 using namespace std;
6 int main() {
string line;
bool result;
7
8.
/* Type your code here. */
11
12
return e;
13 }
14
O O1 234
Transcribed Image Text:main.cpp 1 #include <iostream> 2 #include <deque> 3 4 using namespace std; 6 int main() { string line; bool result; 7 8. /* Type your code here. */ 11 12 return e; 13 } 14 O O1 234
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT