Question: Create a program that implements Stacks in Java 1. The stack should have a maximum of 10 elements. 2. The user should see a simple

Create a program that implements Stacks in Java

1. The stack should have a maximum of 10 elements. 2. The user should see a simple introduction message. 3. The contents of the stack will be displayed 4. The pointer will then be displayed. 5. The user will be given an option to select whether to pop, push or exit. 6. If the user selects Pop, the program will remove the element at the top of the stack. and loops back to step 3. **If the user selects Pop and the stack is empty, the program should tell the user that the stack is empty and loops back to step 5. **If the user selects Push, the program will ask for an input and adds this input to the top of the stack then loops back to step 3. If the user selects Push and the stack is full, the program should tell the user that the stack is full and loops back to step 5. **If the user selects Exit, the program will ask the user if they really wants to exit or not. If the user confirms, the program closes. If the user denies, the program loops back to step 3.

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!