Question
A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or level. In
A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or level.
In this assignment, you need to create a program that user can enter a word, reverse the word and check if the word is a palindrome word using linked list. At the end of the program, it will list all of the palindrome words from the words entered.
The program must consist of the following method/function:
- menu() as interface for the user
- add_word(string) to enter the word to the list
- show_list() to display the lists
- reverse_word(string) to reversed the word
- palindrome(string) to check if the word is palindrome
- palindrome_list() to list all of the palindrome words
- delete_list() to delete list
Example, segment of output:
How many words you want to enter: 3
Please enter a word: kayak
Please enter a word: madam
Please enter a word: world
Reversed the word: kayak
Reversed the word: madam
Reversed the word: dlrow
kayak, is a palindrome word.
madam, is a palindrome word
world, is not a palindrome word.
List of the palindrome words: kayak, madam
Declaration node and functions:
//declaration of node
struct Node{
string p_word;
Node *plink;
};
void menu();
void add_word(string);
void show_list();
void reversed_word(string);
void palindrome(string);
void palindrome_list();
void delete_list();
Instructions:
- This is an individual assignment.
- Analyse the problem by using a flowchart/pseudo code.
- Write a program C++ based on the output given.
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