Write the following program in Java: The first prompt is for the user to select an one of the actions listed below... PushA(x): Push element x on stack A. \user inputs a number to be pushed PushB(x): Push element x on stack B. \user inputs a number to be pushed MultiPopA(k): Pop min{k,n} elements from A. \ user inputs n as the number of elements to pop and display MultiPopB(k): Pop min{k,m} elements from B. \ user inputs m as the number of elements to pop and display Transfer(k): Repeatedly pop an element from A and push it on B, until either k elements have been moved or A is empty. \unser inputs k as the number of elements to transfer
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |