public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ s

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ s

Post by answerhappygod »

Public Static Void Main String Args Stack Strstack New Stack String Str Char Ch For Int I 0 I 10 I S 1
Public Static Void Main String Args Stack Strstack New Stack String Str Char Ch For Int I 0 I 10 I S 1 (20.01 KiB) Viewed 35 times
public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ str = JOptionPane.showInput Dialog("Enter an alphabet"); ch str.charAt(0); if(! (ch == 'u')) [ || ch == 'e' ||ch == '1'||ch == strStack.push(str); System.out.print (str } } //DIAGRAM #1 System.out.printin(); for (int i=0; i <strStack.size(); 1+ 3) strStack.pop(); //DIAGRAM #2 while (!strstack.isEmpty()) System.out.println(atrstack.pop()); end of main d) Draw the TWO diagram of strStack to show its content when the program executes at DIAGRAM #1 and DIAGRAM #2. (4 marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply