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 has the minimum fields you will need to output as well as the validation rules for Specifica- tion B4.
Table 1: Data dictionary for Inventory data structure.
Field Name | Validation Rules |
Item Id Number | 5 digits only |
Quantity at Hand | Cannot be negative |
Wholesale Cost | Cannot be negative |
Retail Cost | Automatically calculate 100% markup |
Date Added to Inventory | Use 9/9/99 for all instances |
Create an alphabetic menu similar to figure 1. Enter a letter to indicate your selection.
Create an array on the heap. Initialize it to whatever size you feel you will need to make this program run. This is your main data structure. You can either use one array with structs or classes or multiple parallel dynamic arrays.
Allows you to add records to the end of the inventory data struc- ture you created. This is activated with the first menu option above.
Remove elements from the end of your inventory structure when you select the second menu option. Shrink your array accordingly.
Create a date class to handle all date related tasks. Figure 2 indi- cates the minimum elements you'll need.
Add a method in your Date class which allows the class to per- form auto diagnostics. In an ideal world, you would use this method to test all the critical components of your class. That way, you can prove you class will perform as advertised and you will have an early warning if some changes you made introduced errors. Run this method after you call your ProgramGreeting() because I will be looking for the test results. You need a minimum of 2 tests for the entire Date class.
Only allow the first letter of each line on the main menu as valid inputs. Obviously, you will need to make sure you don't have two lines which start with the same letter.
Apply one of the validation rules from Table 1 to either Add new item or Edit item (Spec A1) menu selections. Reprompt if incorrect input. You do not need to use a string to handle this input.
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.
Overload the stream extraction operator somewhere in your pro- gram. I'm guessing the Inventory struct is the easiest place to do this.
Overload the stream insertion operator somewhere in your pro- gram. I'm also guessing the Inventory struct is the easiest place to do this too.
This is a method 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.