Question: C + + using namespace std; This assignment has three parts. First, you will need to have a Product structure which will be contained in

C++ using namespace std;
This assignment has three parts. First, you will need to have a Product structure which will be contained in the Store.h file. Its members are: int UPC string desc double qty In the Store.h file, which contains the Store class are the following private member variables: Member Variable Location Description storeNumber An int that holds an Storess ID number. The store numbers are assigned below via the use of the overloaded constructor. storeLocation A string that holds a Stores Location, the Location may contain a space. such as: John Doe. The store locations are assigned below via the use of the overloaded constructor. ptrProd A pointer to an array of Products. yearsInBusiness An integer that contains the number of years the store has been in business. This is also set via the use of the overloaded constructor to the values shown below. nextIndex A integer containing the index in the Products array that points to the next element in the array to be processed. capacity An integer that contains the number of elements in the array containing the stores Products. countProducts The number of different products in the store. The class should have the following public member functions. You may not create more member functions than those listed below: Member Function Location Description Constructor This constructor will set StoreNumber to be 0, StoreLocation to be unassigned, yearsInBusiness to be 0, nextIndex=0, capacity=20; coountProducts=0, ptrProd points to dynamically allocate memory with the size of capacity Overloaded constructor This constructor should have four input parameters, integer for StoreNumber, a string for StoreLocation, an integer for yearsInBusiness, and an integer for capacity. Each parameter should be assigned to the corresponding member attributes. The remaining attributes should be initialized as the default constructor does. Destructor The destructor display a message in the following format: The destructor is running for storeNumber-storeLocation (e.g The destructor is running for store 111-Main Street) And then it should reset StoreNumber to be 0, StoreLocation to be unassigned, yearsInBusiness to be 0, nextIndex to be 0 capacity to be 0 countProducts to be 0 release the dynamically allocate memory setStoreNumber Accepts an int argument and copies it into the StoreNumber member variable setStoreLocation Accepts a string argument and copies it into the StoreLocation member variable setYearsinBusiness Accepts an integer argument and copies it into the YearsInBusiness member variable getStoreLocation Returns the value in StoreLocation getStoreNumber Returns the value in StoreNumber getYearsInBusiness Returns the value in YearsInBusiness addProduct Inserts a product into the stores product array and increments countProducts. getNextProduct Returns the product in the array pointed to by nextIndex and increments nextIndex. resetIndex Sets the value of nextIndex to zero. Must execute this function before the display can work. getCount Returns the countProducts value. Class declarations should be in Store.h, and member function definitions should be in Store.cpp. Do not define any inline functions. The driver program should be in a file Location StoreDriver.cpp. Driver program (StoreDriver.cpp) should have only the following two functions. It should also dynamically allocate a Store array of 3 elements. const int SIZE =3; Store* ptrStore = new Store[SIZE]; Then set the Store data as follows: Store1: number 111, location=Main Street, years in business=50 Store2 number=222, location=Pine Street, years in business =30 Store3 number=333, location=Telegraph Road, years in business=25 int displayStore(Store &store) Use the sample output below for the format. Make sure to include the totals shown. Return the total value for the store in order to calculate the sum for all stores. void loadStore(Store &store, string file) Use the included data files for each store to load the products associated with each store.. Store1s data file is Products1.txt. Store2s data file is Products2.txt. Store3s data file is Products3.txt Other Requirements: 1. Use only the functions described here. 2. Use string line(60,*) for line in the sample output 3. The main function should be less than half a page with return 0 included. a. Main function should only call other functions and display messages. 4. Your output should be similar to the provided output (attached below), including format and messages. 5. Use #ifndef.. etc. on top of your Store.h Sample Output: (notice the line separator presented here has 60*)
Store # 111 on Main Street has been in business for 50 years and contains 18 products ------------------------------------------------------------10101 Chicken Meat Pie 80010102 Beef Meat Pie 55010103 Turkey Meat Pie 68020735 Chicken Strip Dinner 1000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!