Implement a generic stack and queue classes (StackWAS and QueueWAS, named to avoid confusion with the classes already defined in the JDK), using an internal array to store the elements.

Specific requirements include:

  • Implement a driver class for the StackWAS class. There should be appropriate comments in the source code files.
  • Use the menu based approach you defined in Week 1 to test your stack class.
  • Implement a driver class for the QueueWAS class. There should be appropriate comments in the source code files.
  • Use the menu based approach you defined in Week 1 to test your queue class.

Methods for StackWAS

  • StackWAS (int) // constructor
  • void push (T)
  • T pop ()
  • T peek ()
  • boolean isEmpty()
  • boolean isFull()
  • String toString ()

Create a test report (stacktest.doc/docx/pdf/) showing the correct behaviour of all the methods; include a description of the design; include screenshots of your running program.

Methods for QueueWAS

  • QueueWAS(int) // constructor
  • void enqueue (T)
  • T dequeue ()
  • T peek ()
  • boolean isEmpty()
  • boolean isFull()
  • String toString ()

Create a test report (queuetest.doc/docx/pdf/) showing the correct behaviour of all the methods; include a description of the design; include screenshots of your running program.

Deliverables:

  • the Java source code files
  • the test report files (stacktest.doc/docx/pdf/, queuetest.doc/docx/pdf/)
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.