Implement STACK of processes in a System using LinkedList class : • Provide the menu as shown below; use an infinite loop; stop when user opts 4. • Add a process should add an int number at the top of...

Implement STACK of processes in a System using LinkedList class : Provide the menu as shown below; use an infinite loop; stop when user opts 4. Add a process should add an int number at the top of queue using the method addFirst(). Remove a process should delete the int from top using the method removeFirst(). Show the stack should display the numbers on the stack using the method System.out.println().
Implement STACK of processes in a System using LinkedList class :<br>• Provide the menu as shown below; use an infinite loop; stop when user opts 4.<br>• Add a process should add an int number at the top of queue using the method addFirst().<br>• Remove a process should delete the int from top using the method removeFirst().<br>• Show the stack should display the numbers on the stack using the method System.out.printlIn().<br>(Sample run of the program )<br>Stack in a System<br>Stack in a System<br>Stack in a System<br>Stack in a System<br>1. Add a process<br>2. Remove a process<br>3. Show the Stack<br>4. Exit<br>Stack in a System<br>1. Add a process<br>1. Add a process<br>2. Remove a process<br>1. Add a process<br>2. Remove a process<br>2. Remove a process<br>1. Add a process<br>3. Show the Stack<br>3. Show the Stack<br>2. Remove a process<br>3. Show the Stack<br>4. Exit<br>4. Exit<br>3. Show the Stack<br>4. Exit<br>Your choice? 1<br>4. Exit<br>Your choice? 2<br>Your choice? 1<br>Your choice? 3<br>Added process # 1<br>Your choice? 1<br>Removed process # 1<br>Added process #2<br>Stack = 1, 2,3<br>Added process # 3<br>Stack = 2,3<br>

Extracted text: Implement STACK of processes in a System using LinkedList class : • Provide the menu as shown below; use an infinite loop; stop when user opts 4. • Add a process should add an int number at the top of queue using the method addFirst(). • Remove a process should delete the int from top using the method removeFirst(). • Show the stack should display the numbers on the stack using the method System.out.printlIn(). (Sample run of the program ) Stack in a System Stack in a System Stack in a System Stack in a System 1. Add a process 2. Remove a process 3. Show the Stack 4. Exit Stack in a System 1. Add a process 1. Add a process 2. Remove a process 1. Add a process 2. Remove a process 2. Remove a process 1. Add a process 3. Show the Stack 3. Show the Stack 2. Remove a process 3. Show the Stack 4. Exit 4. Exit 3. Show the Stack 4. Exit Your choice? 1 4. Exit Your choice? 2 Your choice? 1 Your choice? 3 Added process # 1 Your choice? 1 Removed process # 1 Added process #2 Stack = 1, 2,3 Added process # 3 Stack = 2,3

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here