Question: I need expert help with this program. Please provide source code in C++. Please comment code; show headings for .cpp and .h files; show sample

I need expert help with this program. Please provide source code in C++. Please comment code; show headings for .cpp and .h files; show sample output of functioning program. The first part of the program uses a class template to create a dynamic stack. The second part of the program must integrate this stack class to handle inventory items. Please see the details for the program as follows:

/* Program Requirements Listed Below This Line */

Write your own version of a class template that will create a dynamic stack of any data type. The pop function must return a bool; it should return a false if it was not able to pop an item off the stack. Otherwise, it returns true. The parameter to the pop function is passed by reference and should be the item on the list if it was able to pop something. Create a driver program (main) that shows that the stack works for at least two different data types.

Then, using the previously created stack class, you will create a class called InventoryItem. This class will have its class declaration in InventoryItem.h and its implementation in InventoryItem.cpp. It will have three private data members, an integer serialNum which holds the parts serial number, manufactDate which should be a string that holds the date the item was manufactured, then lotNum which will be an integer that holds the parts lot number. The program should then create a stack with a data type of InventoryItem (stack). The program should loop asking the user to enter in new items to the inventory stack or to remove an item from the inventory stack. The loop should continue until the user indicates they are done. This should be menu driven. When adding an item, the program should ask the user for the information it needs for the 3 data members of the InventoryItem class and add a new item to the stack. When removing an item from the stack, the program should display all of the information in the InventoryItem object that was popped off the stack. When the program ends, it should pop all of the remaining items off the stack and display the data that is in the Inventory items as it pops them off. There should be 3 utility functions that main uses.

void popItem(DynStack* stack) // pops the item off the stack and displays it. void pushItem(DynStack* stack) // pushes the item onto the stack int menu(); // displays the menu and returns the users choice.

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!