Develop an algorithm using the Java programming language that implements a basic stack
Your stack must have the ability to push entries on the stack. Your stack must also have the ability to pop entries off of the stack.
For this assignment, assume that you are developing a system for a manufacturing assembly line that builds automobiles. There are three stations in the manufacturing line where an inspector will visually inspect the vehicle. You program must keep track of these inspections as they occur. You decided to develop your program using a stack data structure. As your vehicle begins the line you will push the number 0, which indicates that that an inspection has not yet occurred, onto the stack three subsequent times.
At each station in the line you will pop one of the items off of the stack. Each time your algorithm pops an item from the stack you must print it out to the console using the System.out.println function. Your algorithm should perform the functions of the stack as illustrated in the above diagram.
You will develop your algorithm using Java code, and by using the Jeliot tool as a development environment. Jeliot can be executed directly from the following website (http://cs.joensuu.fi/jeliot/javaws/jeliot.jnlp). Instructions for using Jeliot can be found at http://cs.joensuu.fi/jeliot/index.php.
As part of your assignment you must submit both a description of the assignment and how your algorithm works including an Asymptotic analysis of your algorithm. Your analysis must include the efficiency of your algorithm expressed in Big Oh notation.
As part of your assignment, you must include the code of your algorithm.
It must provide the correct output based upon the input
It must be composed of concrete steps
There can be NO ambiguity of the flow of the algorithm
The algorithm must have a finite number of steps that is determinable
The algorithm must terminate or complete
Recently Asked Questions
- Did Iran violate international law by failing to timely declare nuclear facilities? Safeguard obligations 2003
- Can you help me with this question please thank you in advance
- Please help me find the annual lease payments due from the lessor, and prepare lease amortization schedule, for each of the following scenarios: Please help