Question: I need this written in C++ Enter a string through the keyboard (for end press Ctrl+A) and declare an empty stack and an empty queue.

I need this written in C++

Enter a string through the keyboard (for end press Ctrl+A) and declare an empty stack and an empty queue. For every character in the string, if it is not a lower case nor an upper case letter, enter it in the stack, otherwise enter it in the queue.

Print both the stack and the queue. Then, pop one by one all the characters from the stack and enter (enqueue) them in the queue. Again, print both the stack and the queue.

Note: use the function islower(character) to get true if the character is a lower case or false otherwise. Similarly, the function isupper(character) returns true if a character is an upper case.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!