Problem 1: A string is a palindrome if it reads the same from front to back as it does from back to front (e.g. "kayak",

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem 1: A string is a palindrome if it reads the same from front to back as it does from back to front (e.g. "kayak",

Post by answerhappygod »

Problem 1 A String Is A Palindrome If It Reads The Same From Front To Back As It Does From Back To Front E G Kayak 1
Problem 1 A String Is A Palindrome If It Reads The Same From Front To Back As It Does From Back To Front E G Kayak 1 (153.72 KiB) Viewed 28 times
Problem 1: A string is a palindrome if it reads the same from front to back as it does from back to front (e.g. "kayak", "rotator" and "noon" are palindromes). When determining whether an alphanumeric string is a palindrome, we often ignore spaces, punctuation and case in the string (e.g. "A man, a plan, a canal --Panama!" is also considered a palindrome). Write a complete C program to read a string, echo it to the screen, determine whether it is a palindrome, and write a message indicating whether it is or isn't. a) Your main function should prompt for the string, read the string, print it, call the strip function (to remove all spaces, punctuation, and turn uppercase letters into lowercase letters), print the new string, then call the reverse function (to place the characters into reverse order) and print the new string resulting. In the final step, you will compare the result of the reverse function with the original string and print a message if the string is a palindrome or not. b) The strip function takes the original string and removes all characters that are not alphanumeric and converts letters to lowercase if necessary. Its prototype (header) is void strip (char originalſ), char stripped()) c) The reverse function places the characters of the original string in reverse order (ex: "abcde" becomes "edcba"). You must use a recursive solution for this function (no loops!). Its prototype (header) is void reverse (char originalſ), char reversed[]) Use the following strings to test your program. The strings in green are palindromes, the ones in red are not. Drab as a fool, aloof as a bard. It ain't over till it's over radar When you come to a fork in the road, take it Marge lets Norah see Sharon's telegram.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply