Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Complete both parts 1 and 2 as follows in C + + : Part 1 : Inventory Bin Stack Design an Inventory class that stores
Complete both parts and as follows in C:
Part : Inventory Bin Stack
Design an Inventory class that stores the following members:
serialNum An integer that holds a parts serial number.
manufactDate A member that holds the date the part was manufactured.
lotNum An integer that holds the parts 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.
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 pushed onto the stack.
If the user wishes to take a part from inventory, the program should pop the topmost 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.
Part : Inventory Bin Queue
Modify the program you wrote in part so it uses a queue instead of a stack. Compare the order in which the parts are removed from the bin for each program.
NOTE: You can use the same main driver program to test all parts of this program implementation. You do not need to create a separate driver program for each step.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started