Question: Hi, I need help writing a C++ program to implement a Stack and a Queue. It will be menu driven as such below: =========================== Main

Hi, I need help writing a C++ program to implement a Stack and a Queue. It will be menu driven as such below:

===========================

Main Menu

1. Stack

2. Queue

3. Quit

Enter Option:

==========================

Option 1(Stack)

Enter filename: data_file

Read each word from, the file and push it onto the stack until EOF. At EOF the program will pop each word from the stack (in doing so it should also free space) and write each word to a new file "report_out". Do not include numbers or punctuation marks in output.

Data_file

The quick brown fox.

Report_out

fox

brown

quick

The

------------------------------------------------------

Option 2 (Queue)

Enter filename: data_file

Read each word from the file and insert each word in the queue until EOF. At EOF the program will remove each word from the queue (free up space) and write each word and word length to a new fole "report_out". Do not include numbers or punctuation marks in output.

Report_out

The 3

quick 5

brown 5

fox 3

Average word length 16/4 = 4 Characters

Option 3(Quit)

"Terminate Program"

Otherwise:

"Error "

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!