Question: please the same the steps but string not integer Implement the previous program by using String instead of integer (Stack of String) The program allows

Implement the previous program by using String instead of integer (Stack of String) The program allows the user to enter String value instead of integer (push(String value ),pop(), peek()), all these methods implement a String value. a. Design a class named StackOfInteger that contains: A private array elements to store integers in the stack b. A private data field size to store the number of integers in the stack C.A constructor to construct an empty stack with a default capacity of 4. d. A constructor to construct an empty stack with a specified capacity. A method empty() that returns true if the stack is empty ii. f.A method push(integer value) that stores value at the top of the stack. This method checks if the stack is full before pushing to it. In case the stack is full, it i.copies the contents of the stack to a new temp array creates a new elements array with double the current capacity iii. copies back temp to elements places value at the top of the new stack A method pop() that removes the integer at the top of the stack and returns it. In case the stack is empty, it returns " SEMPTY" iv
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
