Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PREPARATION Heres a small programming activity to help dust off any cobwebs from your hands-on skills! Read the following description: A palindrome is any alphanumeric

PREPARATION

Heres a small programming activity to help dust off any cobwebs from your hands-on skills!

Read the following description: A palindrome is any alphanumeric text that reads the same forwards and backwards. Capitalization (that is, A versus a and so on), spaces, punctuation marks like commas, periods, apostrophes, hyphens, etc. all are ignored when deciding whether a text string is or is not a palindrome! Typically the term palindrome is applied to a: word (such as noon, eve) number (such as 2002 or 141) sentence (such as Madam, Im Adam or Go hang a salami; I'm a lasagna hog!) There also are such things as palindrome sentences and poetry that read the same word by word forward and backwards (such as Blessed are they that believe that they are blessed.) They are much harder, so WE WILL NOT WORRY ABOUT THEM!

THE CHALLENGE Your task is to write a simple palindrome word, number and sentence detector. You may write your solution in the programming language of your choice. You can click here to visit a website that hosts a palindrome-ness solution just to prove to yourself it can be done! Your solution doesn't have to be so fancy!

Your program should REPEATEDLY do the following: Ask the user to input a line of text (up to 80 characters) from the keyboard. If the only input is the digit or word zero (that is, either 0 or zero) then quit; otherwise Echo the input text back to the user EXACTLY as entered. Tell the user whether the input IS A PALINDROME or IS NOT A PALINDROME.

Your hands-on solutions are awarded points for exhibiting certain features. For this challenge, I will be looking for the following features. (2 points possible for each of 5 features) "loops" to repeatedly ask for input "terminates" as specified correctly accepts input (yells if the input is too long or null) correctly echoes input outputs answer (palindrome or not)

I am using the C++ programming language. Also, the only part I need help with is for the program to "yell if the input is too long or null". Thank you.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Diagram an example of reinforcement-based discrimination. LO2

Answered: 1 week ago

Question

1. Describe the types of power that effective leaders employ

Answered: 1 week ago