• Home
  • Blog
  • UH Dynamic Stack and Queues Program

UH Dynamic Stack and Queues Program

0 comments

1. Static Stack Template:  Write your own version of a class template that will create a static stack of any data type. Demonstrate the class with driver program.

2. Dynamic Stack Template: Write your own version of a class template that will create a dynamic stack of any data type.  Demonstrate the class with a driver program.   

Design an inventory class that stores the following members:

serialNum:               An integer that holds a part's serial number.
manufactDate:         A member that holds the date the part was manufactured.

lotNum: An integer that holds the part’s lot number.

The class should have appropriate member functions for storing data into, and retrieving data from,
these members.
Next, design a stack class that can hold objects of the class described above. If you wish, you may use the template you designed in ( step 1 and 2 above)

Last, design a program that uses the stack class described above.  The program should have a loop that asks the user if he or she wishes to add a part to inventory, or take a part from inventory.  The loop should repeat until the user is finished.

If the user wishes to add a part to inventory , the program should ask for the serial number, date of manufacture, and lot number.  The data should be stored in an inventory object , and push onto the stack.

If the user wishes to take a part from inventory, the program should pop the top-most part from  the stack and display the contents of its member variables.

When the user finishes the program , it should display the contents of the member values of all the objects that remain on the stack.

Grading for Each assignments is Based on following requirements clearly stated as follow: 
a.  Top of each Program you have your Name :  Indicated that this is your work.           (1 point )
b.  Next line is indicating the date you are submitting your program.                               (1 point )
c.  Next line you will write a brief explanation for what this program intend to do.            (1 point )

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}