Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C++. No global variables (variables outside of main() ). All input and output

ID: 3700211 • Letter: I

Question

In C++. No global variables (variables outside of main() ). All input and output must be done with streams, using the library iostream. You may only use the iostream, cstring, string and the cctype libraries (you do not need any others for these tasks). NO C style printing is permitted. (Aka, dont use printf). Use cout if you need to print to the screen. Use C++ strings.

You have somehow been sucked into a cliched 80's action movie, where you're Arnold Schwarzeneg ger's sidekick. You are approaching the final boss fight. However, he has locked himself into a vault which can only be opened by speaking a series of palindromic strings. Fortunately for you, the vil- lain's sidekick is not very competent and has left a large binder of text lying around. 80's Arnold recognizing his less than perfect English diction, has zasked you to identify all the palindromes in the binder and read them to the lock. You decide to write a C++ program to make the job of identifying the palindromes easier for you A palindrome is defined as a string that reads the same forward and backward. For example "Race car" is a palindrome Specifications . The main function should have a maximum of 5 lines. A call to the function, which also stores the returned string in a variable, the print statement and the return statement. (5 points) . In a function called checkPalin, prompt the user to enter a number N and then accept N strings from the user. These strings will consists only of letters (both uppercase and lowercase), numbers and spaces. (10 points) . You can either use an array of strings or process the strings one by one . Check if the strings are palindromes (ignoring case and whitespace). If a string happens to be a palindrome, add it to the end of a result string. (20 points) . After processing all the input, return the result string to main, where it is printed. (5 points) . Prompts are the only print statements allowed outside the main function. In other words you cannot print the palindrome strings in the checkPalin function. . The output should be printed in a single line, and the case of the letters in the input should be (5 points) . You need not check for any errors. . Please include comments wherever appropriate. (5 points) . You have to use C++ string objects for this program Sample Run Regular text is what's printed by your program. Underlined text is user input, shown here as a sample. You will not be printing the underlined parts in your program Enter the number of strings: 9 Enter the strings: Race Car Get to the chopp Mountain Dew BATMAN aco Cat Stressed Desserts Is Mavonnaise an instrument swap paws A Tovotas a Tovota The palindromes are: Race Car Taco Cat Stressed Desserts swap paws A Toyotas a Toyota

Explanation / Answer

Output:-

Enter a number: 3

Enter string 1:

Race Car

Enter string 2:

Get to the Chopa

Enter string 3:

Taco Cat

The palindromes are: Race Car Taco Cat

//Note:- Please leave upvote to help other students with a similar doubt