Question: java Create a program that simulates the undo/redo features of an application. Implement a simple calculator that asks the user for the basic arithmetic operation

 java Create a program that simulates the undo/redo features of anapplication. Implement a simple calculator that asks the user for the basic

java

Create a program that simulates the undo/redo features of an application. Implement a simple calculator that asks the user for the basic arithmetic operation that they would like to perform on the last result Your program will: Prompt the user to enter an initial number (first operand) Then prompt the user for the next operator and second operand evaluate the expression present the user with the result, which will be the new first operand This will continue until the user chooses to quit, or undo (redo) an operation The undo operation restores the last state. The redo operation restores the next state if an undo was previously performed. 1. Create the generic ArrayStack that implements the Stack interface using an array. 2. Create a driver class called As1 PartB_Driver and any other classes/methods that you may require. You must use two stack objects to hold items that will restore the states based on the function (undo "z" or redo "y") selected. Allow the user to quit ("q") anytime. Sample output: Simple Calculator: type z to undo, y to redo, q to quit Enter the first number: 10 Enter the next operation on 10: + 2 = 12 Enter the next operation on 12: - 3 = 9 Enter the next operation on 9: Z UNDO: 12 Enter the next operation on 12: Z UNDO: 10 Enter the next operation on 10: * 10 = 100 Enter the next operation on 100: 75 = 20 Enter the next operation on 20: + 4 = 24

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!