Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

  1. menu() as interface for the user
  2. add_word(string) to enter the word to the list
  3. show_list() to display the lists
  4. reverse_word(string) to reversed the word
  5. palindrome(string) to check if the word is palindrome
  6. palindrome_list() to list all of the palindrome words
  7. 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:

  1. This is an individual assignment.
  2. Analyse the problem by using a flowchart/pseudo code.
  3. Write a program C++ based on the output given.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions