Question: using c++ Write a program that opens a text file and reads its contents into a stack of characters. The program should then pop the

using c++ using c++ Write a program that opens a text file and reads

its contents into a stack of characters. The program should then pop

Write a program that opens a text file and reads its contents into a stack of characters. The program should then pop the characters from the stack and save them in a second text file. The order of the characters saved in the second file should be in the reverse order of the first file. After completely writing the output file, open it for reading and display the contents to the screen. You must use a DYNAMIC STACK TEMPLATE that will work for ANY data type. Your dynamic stack must have push, pop, and isEmpty members. .Your stack should be created in main like this: DynStack stack Member function push pushes the argument onto the stack. Using the push member will look like this: stack.push (catchChar) -Member function pop pops the value at the top of the stack off, and copies it into the variable passed as an argument.Using the pop member will look like this: stack.pop (ch) Member funciton isEmpty returns true if the stack is empty, or false otherwise. Using the isEmpty member will look like this: stack.isEmpty ) Although your program should work with any file, please use the attached input file. Please submit your screenshot, driver, header, implementation, and two text files

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!