Question: You do not need to understand how the graphical user interface is developed nor need you to make any changes in the graphical interface

You do not need to understand how the graphical user interface isdeveloped nor need you to make any changes in the graphical interfaceMake following changes. L 2. Convert the interface and classes to genericwhere ever it necessary Write the code at // TODO Auto-generated methodstub Execution: 1. The following output you will get when you theStackTest Stack Operations 1. LsEmpty 2. isrull 3. Push 4. Pop 5.Peek 6. Diaplay 7. Exit Enter choice of operation 1 stack isEmpty ? true Stack Operations 1. Lempty Type here to search 2.


 
 
 
 
 
 
 
 

You do not need to understand how the graphical user interface is developed nor need you to make any changes in the graphical interface Make following changes. L 2. Convert the interface and classes to generic where ever it necessary Write the code at // TODO Auto-generated method stub Execution: 1. The following output you will get when you the StackTest Stack Operations 1. LsEmpty 2. isrull 3. Push 4. Pop 5. Peek 6. Diaplay 7. Exit Enter choice of operation 1 stack is Empty ? true Stack Operations 1. Lempty Type here to search 2. Latull 3. Push 4. Pop 5. Peek 6. Display Stack Operations 1. isEmpty 2. isrull 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of operation 4 atack is empty atack Operations 1.isEmpty 2. inrull 3. Push 4. Pop 5. Foek 6. Display Stack Operations 1. isEmpty 2. isFull 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of Operation = 6 Items in stack are Stack is empty Stack Operations 1. is Empty 2. is Full 3. Push 4. Pop Stack Operations 1. isEmpty 2. inFull 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of Operation 3 Enter Account Information :: Id: 673 Name: yyy Balance: 5641 5. Peek 6. Display 7. Exit Enter choice of Operation 3 Enter Account Information :: Id: 100 Name: abc Balance: 4578 true Stack Operations 1. isEmpty 2. isFull 3. Push 4. Pop 5. Peek true Stack Operations 1. isEmpty 2. isFull 3. Push 4. Pop 5. Pock 6. Display 7. Exit Enter choice of Operation = 3 Enter Account Information :: Id: 783 Name: E Balance: 2300 Stack is Overflow Stack Operations 6. Display 7. Exit Enter choice of Operation = 3 Enter Account Information 11 Id: 456 Name: rte Balance: 0541 true 1. istpty 2. Pull 3. Push 4. Pop 3. Peek 6. Display 7. Exit Enter choice of Operation-3 Top Iten Account [accountNo-673, saneryyy, balance-3441.01 Stack Operations 1. is Empty 2. isrull 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of Operation = 6 Items in stack are Account (account No 673, name-yyy, balance 5641.0] Account [accountNo 456, name-rte, balance-8541.0] Account [account No-100, name abe, balance 4578.01 Stack Operations 1. isEmpty 2. is Full 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of Operation = 4 Popped Item Account [account No 673, name yyy, balance 5641.0] Stack Operations 1. is Empty 2. isFull 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of Operation = 6 Items in stack are Account [accountNo 456, name-zte, balance-8541.0] Account (account No 100, name abc, balance-4578.01 Stack Operations 1. is Empty 2. isFull 3. Push 4. Pop 5. Peek 6. Display 7. Exit Enter choice of Operation = 7 Thank you package stacklab; public class StackOverFlowException extends Exception{ public StackOverFlowException(String message) { } super (message); } package stacklab; public interface MyStack { public abstract boolean isEmpty(); public abstract boolean isFull(); public abstract boolean push (int item) throws StackOverFlowException; public abstract int pop() throws StackEmpty Exception; public abstract int peekTop() throws StackEmpty Exception; } public class MyStackImpl implements MyStack{ private int[] stack; private int capacity; private int top; public MyStackImpl(int capacity) { super(); } this.capacity. capacity; this.stack new int[this.capacity]; this.top -1; @Override public boolean isEmpty() { } // TODO Auto-generated method stub return false; @Override public boolean isFull() { } // TODO Auto-generated method stub return false; @Override public boolean push(int item) throws StackOverFlowException { // TODO Auto-generated method stub return false; @Override public int pop() throws StackEmptyException { // TODO Auto-generated method stub } return 0; @Override public int peekTop() throws StackEmptyException ( // TODO Auto-generated method stub } return 0; @Override public string toString() ( return null; package stacklab; import java.util.Scanner; public class MyStackTest { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input new Scanner(System.in); MyStacks new MyStackImpl(4); int choice; do { menu(); System.out.print("Enter choice of operation choice = input.nextInt(); switch(choice) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: = "); // TODO Auto-generated method stub break; // TODO Auto-generated method stub break; // TODO Auto-generated method stub. break; default: // TODO Auto-generated method stub break; // TODO Auto-generated method stub break; // TODO Auto-generated method stub break; System.out.println("Thank you for using this program !!!!"); break; System.out.println("Invalid Option Plz enter (1..7) !!!"); while(choice!- 7); public static void menu() { // TODO Auto-generated method stub package stacklab; public class Stack Empty Exception extends Exception{ public StackEmpty Exception(String message) { super (message); } }

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 Programming Questions!