Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are starting out at a new job as a cryptanalyst, you know, a super fancy code-breaker, and were just given your first task! When

You are starting out at a new job as a cryptanalyst, you know, a super fancy code-breaker, and were just given your first task!
When decoded, you will have new study infromation on how to become a better programmer!
At the very least you will be able to show you understand how stacks and queues work!
Write your program in C++ and make sure to use the STL stack and STL queue data structures
Please submit only your one CPP file which solves the problem... I already have all the text files!

Take a look at this text file which contains our jumbled message and the first clue on how to decipher it
The file starts with the following text: "of stack 10 queue Rules queue Developing queue ..."
If you counted, you would find there are 184 total pairs of words

For every pair of words in the file (Examples: "of stack", "10 queue", "Rules queue", "Developing queue", ...):

  • The first word of the pair is a part of the jumbled message
  • The second word of the pair tells you to either place it into a stack or a queue
  • Follow instructions and place the first word into either the stack or the queue

Once you have completed processing all 184 pairs of words, you will have 92 words in the queue, and 92 words in the stack

Now that you have all the words, now it is time to place them back into the correct order
Take a look at this text file which contains the second clue on how to decipher it
The file starts with the following text: "stack queue queue stack ..."
If you counted, you would find there are 184 total words

For every word in the file (Examples: "stack", "queue", "queue", "stack", ...):

  • The word tells you to get the next word from either the stack or the queue
  • If "queue", then print out the front of the queue and then pop it off
  • If "stack", then print out the top of the stack and then pop it off

Once you have completed processing all 184 words, you will now have your unjumbled message!

This is the file that needs to be decoded:

of stack 10 queue Rules queue Developing queue Safety queue Critical queue release stack before stack addressed stack Code queue be stack should stack active; stack warnings stack possible stack 1. queue all stack with stack all queue very queue Compile stack simple queue pointers. stack single stack use stack flow queue pointer stack Limit stack simple stack constructs queue - queue and stack files stack the stack goto queue to stack setjmp queue or queue longjmp queue be stack constructs, queue or queue preprocessor stack or queue use stack indirect queue The stack caller. stack recursion. queue parameters stack the stack all queue fixed queue check stack dynamic queue allocation queue No queue function queue be queue longer queue must stack and stack functions, stack nonvoid stack what queue of stack on queue value stack return stack single queue the stack in queue a queue standard queue must stack format queue function stack Each stack one queue of stack the stack per queue at stack objects stack statement queue one queue line queue data stack all stack per queue 6. stack function. stack declaration. queue 5. queue should queue to queue per stack average stack density stack assertion stack minimally queue code's stack The stack and stack two queue line stack with stack assertions queue paper stack of stack sheet stack Declare queue a stack smallest queue possible queue printed stack level queue be stack scope. queue can stack 7. queue than stack calling queue check queue each queue called queue function queue should stack 4. stack validity queue initialization. stack after stack of queue memory stack use stack not stack Do stack all queue 3. stack provided queue by queue bound. stack upper stack the queue 8. queue of queue the queue a stack must queue limited queue inclusion queue of queue header queue macro queue definitions. queue 9. queue to queue loops stack Give stack a queue 2. stack dereference, queue and queue do queue not queue use queue direct stack function queue statements, stack use stack not stack do stack control stack 10. queue all queue warnings queue to stack code stack then queue Restrict stack the queue for stack NASA's stack software. queue

Step by Step Solution

3.26 Rating (121 Votes )

There are 3 Steps involved in it

Step: 1

Heres a C program that uses the STL stack and queue data structures to decode the given message acco... 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

Recommended Textbook for

Auditing A Practical Approach

Authors: Robyn Moroney, Fiona Campbell, Jane Hamilton

4th Edition

0730382648, 978-0730382645

More Books

Students also viewed these Operating System questions

Question

Explain why provisions are difficult to audit by control testing.

Answered: 1 week ago