Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) If the English word begins with aconsonant, then the first letter is placed a

ID: 3615659 • Letter: 1

Question

    1) If the English word begins with aconsonant, then the first letter is placed at the
end of the word and the suffix "ay" is appended.

    2) If the English word begins with a vowel,then the first letter is placed at the
end of the word and the suffix "tay" is appended.

   3) If the English word is one character long, thenthe suffix "tay" is appended.

You should create two standard queues, implemented using singlylinked lists, to hold your phrases.
The head pointer to the first queue should be named EnglishPhrase(or something similar),
and it should point to the head of a singly linked list containingthe original English phrase.
The head pointer to the second queue should be named PigLatinPhrase(or something similar),
and it should point to the head of a singly linked list containingthe translated Pig Latin phrase.

You will also need to write a menu-driven routine that willallow users to test your program.
This menu should allow users to (1) input a phrase in English; (2) translate the current phrase
from English to Pig Latin; and (3) print either the originalphrase or the translated phrase to
the screen.

#define MAX_WORD_CHARS (30)

typedef struct WordNodeType
{
char word[MAX_WORD_CHARS];
struct WordNodeType *next;
}WordNode;

Whatever the definition for your node, you will need toimplement the following functions:

WordNode* translateWord(WordNode* NextWord)
    Precondition: NextWord is passed in as aparameter and points to a WordNode
                          containing and English word.
    Postcondition: A pointer to a new nodecontaining the Pig Latin translation of
                          NextWord is returned to the calling functionusing a return statement.
                          NextWord remains unchanged.

void printPhrase (WordNode* Phrase)
    Precondition: None.
    Postcondition: If Phrase points to a validlinked list, all the words contained in the list
                          have been printed in the order that they appearin the list.
                          If Phrase is a NULL pointer, an appropriatemessage is printed.

Add whatever additional functions and variables you wish toimplement the program.

As long as you properly implement the queues using linked listsof nodes allocated using memory
from the heap, together with the above two functions, you mayimplement the remainder of your
Pig Latin translation program however you like. Just rememberto use appropriate variables,
constants, functions and coding style so that your code is readableand effectively modularized.

Explanation / Answer

Dear..