Question: Write a program to implement a stack for the same data and show its implementation. Here is the structure and class definitions you will need

Write a program to implement a stack for the same data and show its implementation. Here is the structure and class definitions you will need for this problem. struct StackItem { string fname: string lname: double salary: StackItem *next: }: class Stack { private: StackItem *top: bool isempty: public: Stack() { top = NULL: isempty = true: } void push (StackItem *item): void pop(): }: Write definitions for the push and pop functions. Use the following main function to test your ur code. int main() { ifstream fin: fin.open("HW3Data.dat"): Stack my_Stack: string fname, lname: double salary: StackItem *item = new StackItem: while (fin > > fname > > lname > > salary) { item fname = fname: item lname = lname: item salary = salary: my_Stack.push (item): } for (int i = 0: i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
