C++
Write a program that uses a structure to store the followinginventory information in a Binary file and access it using RandomAccess Method:
Item description
Quantity on hand
Wholesale cost
Retail cost
Date added to inventory
The program should have a menu that allows the user to performthe following tasks:
Add new records to the file
Display any record in the file
Change any record in the file
For exact menu option text please see the test cases below:
fstream inventory;
inventory.open(“inventory.dat”, ios::out|ios::in|ios::binary);
if (inventory.fail())
{
inventory.open(“inventory.dat”, ios::out|ios::in | ios::binary|ios::trunc );
if (inventory.fail())
{
cout << “Error opening file….”;
return 0;
}
}
Output has to be the same:
Inventory Program Menu 1. ADD NEW Record 2. DISPLAY Record 3. MODIFY
PayPal Gateway not configured
PayPal Gateway not configured