Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This exercise is from Ch12, Programming Project 2b, p275/276. Write a program called palindrome.c which has a function check_palindrome() . Your main function must read
This exercise is from Ch12, Programming Project 2b, p275/276. Write a program called palindrome.c which has a function check_palindrome() . Your main function must read an input string from the user, then make a call to check_palindrome() to confirm whether it's a palindrome (the letters in the message are the same from left to right as from right to left). If it is a palindrome, the function should return iit is not a palindrome, it should return .Based on the return value of check_palindrome () , your main() function must print an appropriate output message. A user input string will have at most 100 characters. Ignore all characters that are not letters when checking for palindromes. Your program MUST use pointers and NOT integer array indices (le, ana5 etc.) to process the character array. Examples Enter a message: He lived as a devil, eh? Palindrome Enter a message: Madam, I am Adam. Not a palindrome You must also test your solution. Create a separate file called testcases.c which implements five test cases for your palindrome function. Each test should print the test input that you have defined and hardcoded for it to use, make a call to your palindrome function, and print the result based on the return from check_palindrome ) (Test passed" or "Test failed"). Ensure that each of your testcases exercises a different equivalence class - an equivalence class is a certairn grouping in the domain that you are examining (in this case, the input). For example, if you were creating equivalence classes of some integer input i for a function you were testing, you might define the following equivalence classes 1 MINIMUM INTEGER MINIMUMINTEGER
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started