Question: data structure Write a Java program that implements 2 stacks. Your program will ask users to Input odd and even numbers as the user wishes

data structure

  1. Write a Java program that implements 2 stacks. Your program will ask users to Input odd and even numbers as the user wishes ( -1 to stop ),

It will check if the number is even it will push it in to the 1st stack and if its odd it will push it in to the 2nd stack.

Then the program will display back the elements in both stacks (even numbers) and (odd numbers) at the end of the program.

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