A+ Work



Source file and executable are placed in a folder.

Indent code and insert comments to document your program. 
Program must be implemented and run as instructed.

write a program to keep track of a hardware store inventory. The store sells various items. For each item in the store, the following information is kept: item ID, item name, number of pieces ordered, number of pieces currently in the store, number of pieces sold, manufacturer’s price for the item, and the store’s selling price. At the end of each week, the store manager would like to see a report in the following form:

                      Friendly Hardware Store

itemID itemName       pOrdered pInStore pSold manufPrice sellingPrice
4444   Circular Saw        150      150     0      45.00      125.00
3333   Cooking Range        50       50     0     450.00      850.00
*
Total Inventory: $
Total number of items in the store: _____

The total inventory is the total selling value of all of the items currently in the store. The total number of items is the sum of the number of pieces of all of the items in the store.
The program must be menu driven, giving the user various choices, such as checking whether an item is in the store, selling an item, and printing the report. After inputting the data, sort it according to the times’ names. Also, after an item is sold, update the appropriate counts.
Initially, the number of pieces (of an item) in the store is the same as the number of pieces ordered, and the number of pieces of an item sold is zero. Input to the program is a file consisting of data in the following form:

itemID
itemName
pOrdered manufPrice sellingPrice

use seven parallel vectors to store the information. The program must contain at least the following functions: one to input data into the vectors, one to display the menu, one to sell an item, and one to print the report for the manager.


Complete the above problem with the following modifications:
Use the functions: (data file is also provided)

//getData() reads input file into vectors.
void getData(ifstream& inp, vector<int>& iID, vector<string>& iName,
             vector<int>& pOrdered, vector<int>& pInStore,
             vector<int>& pSold, vector<double>& manufPrice,
             vector<double>& sPrice);

                 const vector<int>& pInStore,

The following is a sample output:

Welcome to the Friendly Hardware Store!
Choose among the following options.
1: To see if an item is in the store.
2: To buy an item.
3. To check the price of an item.
4: To print the inventory.
9: To end the program.


                      Friendly Hardware Store

itemID itemName       pOrdered pInStore pSold manufPrice sellingPrice
4444   Circular Saw        150      150     0      45.00      125.00
3333   Cooking Range        50       50     0     450.00      850.00
1111   Dish Washer          20       20     0     250.50      550.50
2222   Micro Wave           75       75     0     150.00      400.00

Total Inventory: $102260.00
Total number of items in the store: 295


Welcome to the Friendly Hardware Store!
Choose among the following options.
1: To see if an item is in the store.
2: To buy an item.
3. To check the price of an item.
4: To print the inventory.
9: To end the program.
1

Enter the name of the item: Circular Saw
Circular Saw is in store.
Welcome to the Friendly Hardware Store!
Choose among the following options.
1: To see if an item is in the store.
2: To buy an item.
3. To check the price of an item.
4: To print the inventory.
9: To end the program.

Enter the name of the item: Micro Wave
Enter the number of pieces: 2

Amount Due = $800.00
Welcome to the Friendly Hardware Store!
Choose among the following options.
1: To see if an item is in the store.
2: To buy an item.
3. To check the price of an item.
4: To print the inventory.
9: To end the program.

Enter the name of the item: Circular Saw
The price of Circular Saw = 125.00.
Welcome to the Friendly Hardware Store!
Choose among the following options.
1: To see if an item is in the store.
2: To buy an item.
3. To check the price of an item.
4: To print the inventory.
9: To end the program