Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a stack data structure using arrays, which can hold *any* primitive data type values AND *any* type of objects. Your stack should have the

Implement a stack data structure using arrays, which can hold *any* primitive data type values AND *any* type of objects.

Your stack should have the same methods with the one in slides; push, pop, top.

Also, it should have one default constructor, and one with a single parameter.

Implement your stack using two approaches discussed in class:

1. MyStackPolymorphic.java using polymorpism

2. MyStackGeneric.java using Generics

3. Both version should throw an exception (MyStackEmptyException) when pop() is called if the stack is empty

4. Implement a single driver (MyStackDriver.java) to test BOTH data structures

5. Submit MyStackPolymorphic.java, MyStackGeneric.java, MyStackDriver.java and a screenshot of your test as a zip file.

We will work on a working sample on Monday (2/24)

List your questions under DiscussionBoard, A003

The due date of this assignment will not be extended. Please do not submit or email after due date/time.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Solve Prob. 27.4 with the finite-difference approach using x = 2.

Answered: 1 week ago