Question: using c++ Q3. Topic: Inheritance CLO-3 10 Marks Create a Class Named Stack that has an integer array of size 5 and a variable top

 using c++ Q3. Topic: Inheritance CLO-3 10 Marks Create a Class

using c++

Q3. Topic: Inheritance CLO-3 10 Marks Create a Class Named Stack that has an integer array of size 5 and a variable top for location of data on stack. Make a function named push to place data in stack. Make a function named pop to get data from stack. Create another Class named Stack2 that is inherited from class Stack. Make push and pop functions in this class Stack2. Now push function before pushing the data on stack first checks if the stack is full. If the stack is not full then it calls the push function of its parent class. o Now pop function before popping out the data from stack first checks if the stack is empty. If the stack is not empty, then it calls the pop function of its parent class. Make an object of Stack2 class and test the push and pop functions in main() function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!