Question
PLEASE DO NOT COPY FROM OTHER EXPERT NOTES AND POST THE FULL ANSWER AND OUTPUT. Please satisfy all bundles of specifications; every single specification is
PLEASE DO NOT COPY FROM OTHER EXPERT NOTES AND POST THE FULL ANSWER AND OUTPUT. Please satisfy all bundles of specifications; every single specification is required to be satisfied, not just one bundle. They are requirements.
C++ Inventory Inquisitor Problem:
Your significant other has had a flash of inspiration - the world needs another inventory management program! You agreed to write it for them because love is indeed blind. Table 1 below has the minimum fields you will need to output, as well as the validation rules for Specification B4.
Requirements:
Do not optimize for computer performance. Global variables in any form are forbidden. This includes #define statements, too. You can, and should, put classes and structs right under your include statements and using namespace std; statement. You cannot use any data structures from the standard template library. No
REQUIRED Specification Bundles:
"C" Specification Bundle.1:
// Specification C1 - Alpha Menu Create an alphabetic menu similar to figure 1. Enter a letter to indicate your selection.
Add Inventory - Add new elements to the end of your inventory array. You will need to resize your dynamic array for this to occur. Delete Inventory - Remove the last element of your inventory array and shrink it. Edit Inventory - Enter a record index number and allow the client to change the values. You do not need to edit the data values as those are fixed for this assignment. Display Inventory - Display all the records in your inventory array. Quit Program - exit this program.
// Specification C2 - Dynamic Array Create an array on the heap. Initialize it to 1 element. You will add elements as necessary.
// Specification C3 - Resize Array
Allows you to add records to the end of the inventory data structure you created. This is activated with the first menu option above. Create a pTmp pointer variable for the new data structure. You will also subtract elements from the end as well.
// Specification C4 - Menu Input Validation Only allow the client to select the valid menu options, upper or lower case. Reprompt if other options are selected. Allowable values are the first letter of each option. Obviously, you will need to make sure you dont have two lines which start with the same letter.
"B" Specification Bundle. // Specification B1 - Date class Create a Date class to handle all date related tasks. Grab the date from the system. You do not need to have a provision for a manually entered date. Your ComponentTest method should only check to see if the computer is generating the proper year. You do not need to test the other date elements.
//Specification B2 -RandNo Class
Create a random number class, RandNo. You will use this to return the random number for the Wholesale cost (but you can make it flexible for other stuff too if you want). It should know seed initialization state and randomly set it once if needed.
// Specification B3 - Singleton Design Pattern
Use the singleton design pattern to make sure your time set seed code only runs once.
// Specification B4 - Inventory Entry Input Validation Apply the first three validation rules from Table 1 to Add new item and Edit item (Spec A1) menu selections. Re-prompt if incorrect input. Create an InVal class or function to perform this check.
"A" Specification Bundle. // Specification A1 - Edit Inventory Add the capability to edit the contents of any inventory item. Edit is different from delete. You may apply input validation from Specification B4 if you wish.
// Specification A2 - Overload operator
Overload the stream extraction operator somewhere in your program. Im guessing the Inventory struct is the easiest place to do this.
// Specification A3 - Overload operator Overload the stream insertion operator for the RandNo class. This will be how you will enter a user specified seed. This method will prompt the user and use the integer value they provide as the random number seed - overwriting the time value if needed.
// Specification A4 - UnitTest() function in main() The UnitTest function is where you call all the ComponentTest() methods from all the classes you use. You also put tests in here to verify your classes do indeed, work together. In this assignment, use this method to call your various ComponentTest() methods. You should have a ComponentTest() method in every class you create.
Table 1: Data dictionary for Inventory \begin{tabular}{|ll|} \hline Field Name & Validation Rules \\ \hline Item Id Number & 5 digits only \\ \hline Quantity at Hand & Cannot be negative \\ \hline Wholesale Cost & Cannot be negative \\ \hline Retail Cost & Increase Wholesale Cost by random 10%50%. \\ \hline Date Added to Inventory & Use system date. \\ \hline \end{tabular}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