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 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

Requirements

  • Do not optimize for computer performance.
  • Global variables in any form are forbidden. This includes #define statement's, too. You can, and should, put classes and structs right under your include statements and using namespace std; statement.
  • Put a Source File Header at the top of your source file.
  • Include a void ProgramGreeting() function. This will run auto- matically once when the program first starts. This function should display (on individual lines):
    • A welcome message.
    • Your name (as author).
    • The date this assignment is due. Format this as MonthName day, year. Example: June 30, 1988.
  • Do not your c (.h) style libraries. Use c++ libraries instead.
  • You cannot use any data structures from the standard template library. No < vectors > or < arrays > or anything like that. You can use C-Style arrays, however. You can also build your own dynamic memory structures.

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 inven- tory 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 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.

Specification C3 - Resize Array - add to end

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.

Specification C4 - Resize Array - subtract from end

Remove elements from the end of your inventory structure when you select the second menu option. Shrink your array accordingly.

Specification B1 - Date class

Create a date class to handle all date related tasks. Figure 2 indi- cates the minimum elements you'll need.

Specification B2 - ComponentTest method in Date

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.

Specification B3 - Menu Input Validation

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.

Specification B4 - Inventory Entry Input Validation

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.

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 pro- gram. I'm guessing the Inventory struct is the easiest place to do this.

Specification A3 - Overload operator >>

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.

Specification A4 - UnitTest() method in main()

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.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.