Write a Java program that implements a queue and stack. The program will ask users to: Input a number as the size. Input positive and negative numbers. a. If the number is positive, it will push it in...


Write a Java program that implements a queue and stack. The program will ask users to:<br>Input a number as the size.<br>Input positive and negative numbers.<br>a. If the number is positive, it will push it in to the queue.<br>b. If the number is negative it will push it in to the stack.<br>Then the program will display back the elements of the queue which is the positive numbers<br>with their summation at the end. And it will display back the elements of the stack which is the<br>negative numbers with their summation at the end of the program.<br>

Extracted text: Write a Java program that implements a queue and stack. The program will ask users to: Input a number as the size. Input positive and negative numbers. a. If the number is positive, it will push it in to the queue. b. If the number is negative it will push it in to the stack. Then the program will display back the elements of the queue which is the positive numbers with their summation at the end. And it will display back the elements of the stack which is the negative numbers with their summation at the end of the program.

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here