Instructions:

1. From Assignment #1:

You will need to implement the following features from Assignment #1:

  • the Purchase and the PurchArray classes
  • the product purchase feature
  • modify the print customers feature

For more details, see the Assignment #1 description.

Note: Insufficient datafill means that your assignment cannot be adequately tested; this may incur deductions of up to 100% of the assignment

2. Modify the program to use dynamically allocated memory

You will change the program to allocate all data objects dynamically. This includes:

  • the dynamic allocation of all product, customer, and purchase objects
  • the modification of all array classes to contain an array of pointers to objects
  • the explicit deallocation of all dynamically allocated memory; memory leaks will be penalized

Note:

  • You must change your program must use data object pointers everywhere for all product, customer and purchase objects; do not use references and do not make copies of any object
  • In existing and new features, where a customer or product cannot be found, the program must report the error and continue execution

3. Implement the add more inventory feature

You will implement the add more inventory feature, which is available from the admin menu. This feature increases the number of units of a particular product because new stock has arrived. You will prompt the user to enter the product id and the number of new units that have arrived. Then the number of units of that product will be increased by the specified amount.

Constraints

  • your program must follow the existing design of the base code, including the encapsulation of control, UI, entity and array object functionality
  • do not use any classes or containers from the C++ standard template library (STL)
  • do not use any global variables or any global functions other than main
  • do not use structs; use classes instead
  • objects must always be passed by reference, not by value
  • your classes must be thoroughly documented in every class definition
  • all basic error checking must be performed
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.