Example of program segment:

Return the last item of a queue leaving the queue unchanged

while (!q.isempty()) { int e; q.deleteQueue(e); p.addQueue(e); } cout<<e<<endl; while (!p.isempty()) { p.deleteQueue(e); q.addQueue(e); }

I have attempted these questions on my own, but failed horribly. I ask anyone who has knowledge of C++ to help assist me. I really appreciate it. I do not want to fail. I want to use the variables and stuff that I used in the example above. If anyone wants to help me please reply back!

1. Determine if a word is a palindrome using queues

2. Replace every occurence of every (e) in a queue with an x

3. Give the sum of the 1st 3 elements in a queue leaving the queue unchanged

4. Reverse the elements in a queue (using recursion)

5. Exchange the front 2 elements of a queue

*** MOD EDIT: Added code tags. Please ***