Write a client program that uses the Stack abstract data type to simulate a session with a bank teller. Unlike most banks, this one has decided that the last customer to arrive will always be the first to be served. Create classes that represent information about a bank customer and a transaction. For each customer, you need to store a name, current balance, and a reference to the transaction. For each transaction, you need to store the transaction type (deposit or withdrawal) and the amount of the transaction. After every five customers are processed, display the size of the stack and the name of the customer who will be served next.
Write a method peekNextToTop that allows you to retrieve the element just below the one at the top of the stack without removing it. Write this method for both ArrayStack and Linked Stack. It should return null if the stack has just one element, and it should throw an exception if the stack is empty.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here