Write code which uses an array to implement a stack of nonnegative (i.e. greater or equal to zero) integers.
Your code should implement the following functions:
Returns true if the stack is empty or false if it is not.
Returns true if the stack is full or false if it is not.
Accepts an integer parameter. Adds the value to the stack and returns the value of the parameter if successful. If the stack is full or the parameter is a negative integer, returns -1.
Returns the value at the top of the stack. Returns -1 if the stack is empty.
Your answer should include code which tests that each of the four functions is working correctly.