Question: Please Complete the Following in its entirety. Implement LinkedStack class by implementing the peek(), isEmpty(), size(), and toString() method . Design and create a class
Please Complete the Following in its entirety.
Implement LinkedStack class by implementing the peek(), isEmpty(), size(), and toString() method.
Design and create a class called Painting.
-artist: String
-genre: String
-era: String
//constructors
//accessors
//mutators
//toString
Test all methods in LinkedStack and Painting class. Must test the Painting methods through the objects on the Stack, not as an object itself.
Use logically correct packaging structure to group classes.
Implement toString method of StackInterface correctly. Meaning, it should print out the top element first and bottom element last. Must also test the toString method more than once to show it does not obliterate stack.

Utilize the following code (simply create a new project within eclipse and create the following classes and paste given code below (some of the code given may need to be modified)):
LinkedStack Class
package stack;
import exception.StackException;
public class LinkedStack
public void push(T element) { LinearNode
//complete the following implementations within LinkedClass
public T peek() throws StackException{} public int size() {} public boolean isEmpty() {} public String toString() {} }
LinearNode class
package stack;
public final class LinearNode
}
StackException
package exception;
public class StackException extends RuntimeException { public StackException(){ super("The stack is empty"); } public StackException(String msg) { super(msg); }
} StackInterface
package stack;
import exception.StackException;
public interface StackInterface
}
StackDriver class
package driver; import exception.StackException; import stack. *; public class StackDriver { public static void main(String[] args) { StackInterface
Painting class (To do: Test all methods in LinkedStack and Painting class. Must test the Painting methods through the objects on the Stack, not as an object itself).
Objectives:
Successful implementation of Painting Class
Creates a stack object that holds the class objects in Painting Class
Tests all six methods of the stack implementation: pop,push,isEmpty, toString, size, peek utilizing the two stack of your own classes.
Tests all the methods in the Painting class through LinkedStack Object
Implements the six methods in the Stack class. (pop, push, isEmpty, size, peek, toString(call toString to each node/each element in each node (Node.getNext())
Please help !
Java Software Structures DESIGNING AND USING DATA STRUCTURES 4TH EDITION Lewis And Chase
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
