Question: Write program in C++. Please seperate into a Header, Specification, and Main files Task: Create a hash table of a candy stores inventory. The table

Write program in C++. Please seperate into a Header, Specification, and Main files

Task: Create a hash table of a candy stores inventory. The table will be an array of structures. The program should permit price checks and should allow item quantities to be increased or decreased.

Input: The tables data values will be read from a text file. The input file is C162P7candy.txt. The program will initialize the table by using a hash function to place each structure in an appropriate array location. The data structure to use is:

struct Candy

{

string IDcode; // 4-char alphanumeric code

string itemName; // name/description of the candy

double quantity; // quantity on hand, in pounds

double price; // price per pound

};

You may decide on the array size. Create an appropriate hash calculation to assign each element into the array. Decide how collisions will be handled; for this assignment, use a method other than a linear probe.

Processing: Provide a menu for the user. Options should include:

availability check: is an item in stock (quantity > 0), and if so, what is its price?

purchase: decrement the quantity by some amount

delivery: increase the quantity

inventory: print the complete inventory to a hard copy report

Output: Upload your program to D2L.

Program is to be well documented both internally and externally.

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 Databases Questions!