You do not need to understand how the graphical user interface is developed nor need you...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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); } } 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); } }
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Physical Science the table shows equivalent Fahrenheit and Celsius temperatures. Degrees Fahrenheit Degrees Celsius 32 ................... 0 68 ................. 20 104 ................. 40 140...
-
The lognormal distribution, on which Example 2.3.10 is based, has an interesting property. If we have the pdf then Exercise 2.35 shows that all moments exist and sire finite. However, this...
-
Develop an algorithm for producing all permutations of a set of n elements based on the correspondence described in the preamble to Exercise 14.
-
A book of inertia \(1.2 \mathrm{~kg}\) is placed on top of the spring in Figure 8.18. What is the displacement of the top end of the spring from the relaxed position when the book is at rest on top...
-
St. Teresas Medical Center (STMC) offers a number of specialized medical services, including neuroscience, cardiology, and oncology. STMCs strong reputation for quality medical care allowed it to...
-
What will be the output of the following C code? #include int main() 1 2 3 { 4 5 6 7 8 9 int *ptr, a=5; ptr = &a; *ptr += 1; printf("%d, %d", *ptr, a); return 0;
-
probe, which may be is used to through a duct. modeled as a cylindrical measure the temperature at The aveagevalue of h in the air stream A thermocouple diameter and 10 cm long, an air stream flowing...
-
A highly competent MBA 2019 graduate while participating in the CELEBRITY APPRENTICE was given the task of selling a product in the vicinity of Trump Tower in Las Vegas. The same product was given to...
-
As a financial statement analyst, select two organizations in the same industry and analyze their financial statements over time. The financial analysis period must be, at a minimum, the three most...
-
What government agency provided this GDP report? a. Bureau of Economic Analysis (BEA) b. Bureau of Labor Statistics (BLS) c. Federal Reserve Bank d. Congressional Budget Office (CBO) Q 2 What time...
-
Based on the core indicators and growth determinants described in the "Introduction" & Chapter 1 (North-western Europe) of "A History of the Global Economy" book, how the Gross Domestic Product (GDP)...
-
What should you do if you are on the coast and hear a tsunami siren?
-
On December 31, 20X9, Add-On Company acquired 100 percent of Venus Corporation's common stock for $300,000. Balance sheet information Venus just prior to the acquisition is given here: Cash and...
-
Government is advised to tax goods whose demand curves are inelastic if the goal is to raise tax revenues. If the goal is to discourage consumption, then it ought to tax goods whose demand curves are...
-
In what way is Earth like a hard-boiled egg?
-
Describe evidence from the rock record that supports continental drift.
-
Why was the hypothesis of continental drift dismissed by scientists for decades?
Study smarter with the SolutionInn App