Reference no: EM133655149
Reverse Text (txeT esreveR)
In this programming assignment, we are going to practice using the stack abstract data type. One common use of a stack is to reverse data. In this assignment we are going to allow the user to type in text or tell the program what input file to process to read in string data. While processing this data we are going to store each character into a stack (push). Once all of the data is stored in a stack, we are going to remove (pop) each character, printing each character which will be in reverse order. We will print this to an output file and "echo" print it to the console.
In this assignment. I want you to focus on how to use a stack and also how to make your code as reusable as possible. You will be graded on both using a stack properly and code re-usability.
You must use the stack data structure code from the book that has its own header and source code file just for the stack, a header and source code file for your "ItemType" (you could use a template). You must also turn in a driver source code file.
Do not use anything that would require you to include the libraries algorithm.h or vector.h or similar. If you have any questions about this, let me know before submitting the assignment.
It is ok to ignore white-space. In other words if your input file or the users input has spaces or return carriages in it, ignore those. Note: One way to test your stack code is to use 2 stacks, one to reverse the string, the other stack to put the string back to the original.
Example file list:
TestDriver.cpp
Stack.h
Stack.cpp ItemType.h
ItemType.cpp (Maybe Optional)
Input.dat