It reads the same forwards and backwards.
A palindrome is a word, number or phrase that reads the same backwards as forwards, such the words madam or racecar.
Write a program that allows the user to enter a word or sentence. The program outputs whether the input is a palindrome or not.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
Note the algorithm will need to ignore case, whitespace and punctuation.
Enter a phrase: ABBA
ABBA is a palindrome.
Enter a phrase: 02/02/2020
02/02/2020 is a palindrome.
Enter a phrase: A man, a plan, a canal – Panama
A man, a plan, a canal – Panama is a palindrome.
Enter a phrase: Hello World
Hello World is not a palindrome.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Enter a phrase: saippuakivikauppias
saippuakivikauppias is a palindrome.
Enter a phrase: Tattarrattat
Tattarrattat is a palindrome.
Enter a phrase: A man, a plan, a canal – Panama
A man, a plan, a canal – Panama is a palindrome.
Enter a phrase: palindrome
palindrome is not a palindrome.
Enter a phrase: 1234321
1234321 is a palindrome.
Enter a phrase: String manipulation is fun!
String manipulation is fun! is not a palindrome.
Check that you have: