I am close to being finished with a programming assignment. I just need help on figuring out where I went wrong. I will post the full instructions and the program I have written if anyone can give me the insight on how to fix where I went wrong.
For this assignment, you are to develop a SmartString class that supports inserting into a
string, deleting a substring from a string, and an undo method.SmartStringADT.java
Your SmartString class must implement this ADT and therefore implement thefollowing methods:
Note: the last method, toString, should simply return the SmartString and nothing else!
SmartStringDriver.java
A driver class that I’ve provided for you to run quick tests on your SmartString class.
InvalidSmartStringException.java
The Exception that should be thrown should you encounter an invalid Smart String
action such as trying to delete on an empty string.
Program Requirements:
You must use a Stack to store the operations in order to support undo operations.Note that multiple undo operations can be performed in sequence. Using the JavaAPI Stack is fine or you can use ArrayStack or LinkedStack from the textbook. Consider designing an additional class such as UndoAction, that holds the required information to be placed onto the stack. Only the changes should be stored and not the whole string. Using the example in the introduction, if you add to the Smart String, I am doing great!, then only I am doing great! can be pushed on the stack and NOT the entire Smart String, Hello, how are you doing? I am doing great!
This is what I have so far: