Question: This is a c++ program. create a stack class that handles prime integers only. it should be able to automatically resize(to a larger size only)
This is a c++ program. create a stack class that handles prime integers only. it should be able to automatically resize(to a larger size only) when full, becoming 1.5 times larger than it was. the stack class must contain the standard public functionality of push(),pop(),empty(). The only additional public functionality allowed is peek() or top()method, depending upon your design choice.
use dynamic array for the stack storage. because of this, you must also provide the copy constructor, overloaded assignment operator and destructor.
DO NOT USE ANY OF THE STL(INCLUDING VECTOR TYPE) IN YOUR STACK.
Write a driver test that tests all the methods in your stack class. NOTE THAT WHEN THE DRIVER ATTEMPTS TO ADD A NON PRIME INTEGER TO THE STACK, THE VALUE SHOULD BE REJECTED.
The stack class will be in tow files named "stack.h", "stack.cpp", "p1.cpp"
IT SHOULD BE IN C++.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
