Question: You will create your own GoKartStackImpl using an array implementation. The data stored in each stack will be an integer, to represent the go-kart number.

You will create your own GoKartStackImpl using an array implementation. The data stored in each stack will be an integer, to represent the go-kart number. Go-karts are numbered, starting from 1 in the basic line, and continuing the numbering in the racing line (so the basic go-kart stack will hold go-karts numbered 1 to 4. The racing go-kart stack will hold go-karts numbered 5 to 7). Use constants to define the go-kart number ranges, so the program will work if the company decides to expand the available number of go-karts later. Each stack should be initialized so that all the go-karts are in the stack, with the lowest go-kart number at the bottom of the stack and highest go-kart number at the top of the stack. Note that this means the stack will initially be full. When the stack is empty, there are no more available go-karts available of that type. The GoKartStackImpl class should implement the ability to push and pop go-karts from the stack. You also need to include methods to determine if the stack is empty or full - and use these methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
