Furthermore, we will continue to develop skills related to specification and design, portions of which will be provided. Your implementation must match the provided specification.
The Formal Description section is NOT the actual assignment. The actual assignment will be provided in the Actual Description section of this document.
Write a program which prompts the user for a file containing a list of phrases, one per line. The program should read the phrases and print a list of the perfect palindromes, a list of natural palindromes, a list of regular palindromes and a list of non-palindromes. The lists should be sorted alphabetically. The program should be able to store 1,000 palindromes.
Please label each list as follows:
The XXXXs in the list are:where XXXX is the name of the palindrome class. Furthermore, please print a blank line after printing each list.
Please place each palindrome on a line, enclosed in quotation marks. Please place a tab before the palindromes.
Example input:
racecar god saw I was dog I did, did I? Able was I ere I saw Elba. A man, A plan, A canal: Panama! Madam, I'm Adam. Hello World! spamYour program should produce the following output
Enter a file name =>example.in The perfect palindromes in the list are: "god saw I was dog" "racecar" The natural palindromes in the list are: "Able was I ere I saw Elba." "I did, did I?" The palindromes in the list are: "A man, A plan, A canal: Panama!" "Madam, I'm Adam." The non-palindromes in the list are: "Hello World!" "spam"
Please name the source code file for this palindrome.C/cpp
Please name the source code file for this palSorter.C/cpp
InsertionSort(item A[], size_t size)
- size_t i,j
- i = 1
- while i < size
- j = i
- while j > 0 and A[j-1] > A[j]
- swap(A[j],A[j-1])
- j--
- i++