Analysis

  • Describe the problem including input and output
  • Describe the major steps for solving the problem.

Design

Your UML design (Complete one of the UML designs below) see image.

Listing 19.1

In Listing 19.1, GenericStack< E> is implemented using composition. Define a new parameterized stack class that extends (inheritance) ArrayList. Include two methods, min and max which will return the minimum and maximum values in the stack.

Implement a program that generates and displays at least 15 random Integer objects and uses your new stack class' push method to place them on the stack. Once all the values are on the stack, display the minimum and maximum objects. Then use the stack to display the objects in reverse order.

Repeat the process two more times, once with random Character objects, and once with random Date objects.

Using a GUI (JavaFX or Swing) application is optional.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.