Question: In Java # 28 a-c Show the implementation representation (the values of the instance variables and toplndex) at each step of the following code sequence:

In Java # 28 a-c  In Java # 28 a-c Show the implementation representation (the values

Show the implementation representation (the values of the instance variables and toplndex) at each step of the following code sequence: Stackinterface (String) - new array rounded Stack (string): push (Anna Jane"): Pop () push ('Joseph ") pop ():pop (): pop (): Describes the effects each of the changes would have on the Array RoundedStock class Remove the final attribute from the DKFCAP instance variable. Change the value assigned to DEFCAP = 10. Change the value assigned to DEFCAP = 10, In the first constructor change the statement to elements = (r[])new object [100]: In isEmpty, change topIndex = -1 to topIndex Reverse the order of the two statements in the else clause of the push method. Reverse the order of the two statements in the else clause of the pop method. In the threw statement of the top method change the argument string from Top attempted on an empty stack to hop attempted on an empty stack' Add the following methods to the Array sounded stack class and create a test driver for each to show that they work correctly In order to practice your array loaded skills, code each of these by prove a the internal variable so if the Array Bounded Stack not by calling the previously defined public methods of the class String tostring () -creates and returns a string that correctly represents the current stark Such a method could prove useful for testing and debugging the class and for testing and debugging applications that the class Assume each stacked element already provided its own reasonable toString method. int size() -resume a returns cannot to flow many items are currently on the stack Do not add any instance variables to the ArrayBounded stack less than count element to implement this method. void popSome (int count). removes the top count elements from the stack throws Stack if there are less than count elements on the stack boolean swap start()-if there are less than two elements en the stack retuned otherwise it reversed the order of the top two element on the stack and returns true. T poptop ()-the classic pop operation, a the stack is empty it throws StackUnderflowException; otherwise it both removes and returns the top element of the stack Perform the tasks listed in Exercise 28.butupdate the Array is stack Show the implementation representation (the values of the instance variables and toplndex) at each step of the following code sequence: Stackinterface (String) - new array rounded Stack (string): push (Anna Jane"): Pop () push ('Joseph ") pop ():pop (): pop (): Describes the effects each of the changes would have on the Array RoundedStock class Remove the final attribute from the DKFCAP instance variable. Change the value assigned to DEFCAP = 10. Change the value assigned to DEFCAP = 10, In the first constructor change the statement to elements = (r[])new object [100]: In isEmpty, change topIndex = -1 to topIndex Reverse the order of the two statements in the else clause of the push method. Reverse the order of the two statements in the else clause of the pop method. In the threw statement of the top method change the argument string from Top attempted on an empty stack to hop attempted on an empty stack' Add the following methods to the Array sounded stack class and create a test driver for each to show that they work correctly In order to practice your array loaded skills, code each of these by prove a the internal variable so if the Array Bounded Stack not by calling the previously defined public methods of the class String tostring () -creates and returns a string that correctly represents the current stark Such a method could prove useful for testing and debugging the class and for testing and debugging applications that the class Assume each stacked element already provided its own reasonable toString method. int size() -resume a returns cannot to flow many items are currently on the stack Do not add any instance variables to the ArrayBounded stack less than count element to implement this method. void popSome (int count). removes the top count elements from the stack throws Stack if there are less than count elements on the stack boolean swap start()-if there are less than two elements en the stack retuned otherwise it reversed the order of the top two element on the stack and returns true. T poptop ()-the classic pop operation, a the stack is empty it throws StackUnderflowException; otherwise it both removes and returns the top element of the stack Perform the tasks listed in Exercise 28.butupdate the Array is stack

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!