Problem:>>
You are the owner of a hardware store and need to keep an inventory that can tell you what different tools you have, how many of each you have on hand, and the cost of each one.
Part 1
Implement the class Record that contains the following private and public members
private:
int recordNum;
char toolName [25];
int quantity;
double cost;
public:
void setRecordNumber(int);
int getRecordNumber() const;
void setToolName(string);
string getToolName() const;
void setQuantity(int);
int getQuantity() const;
void setCost (double);
double getCost() const;
Part 2
Write a program for the hardware store with the following functionalities (develop as a menu-driven application):
Function 1: initializeFile
This function initializes the random-access file hardware.dat to 50 empty records.
Function 2: addDataToFile
This function allows the user to input data concerning each tool. See sample below
Record#
|
Tool name
|
Quantity
|
Cost
|
3
|
Electric sander
|
7
|
57.98
|
17
|
Hammer
|
76
|
11.99
|
24
|
Jig saw
|
21
|
11.00
|
Function 3: displayFileContent
This function will display the list of tools stored in the hardware.dat file.
Function 4: deleteRecordFromFile
This function will delete a record for a tool that you no longer have in stock.
Function 5: updateRecord
This function will be used to update the quantity on hand. If the hardware store sells an item, you should decrement the quantity, and vice versa, if new stocks are added. Make provisions for these transactions in this function.
J.W. PRODUCTION