A college must track equipment items purchased using special funds. Create a struct name Inventory that represents an equipment item. An equipment item consists of an 8-alphanumeric inventory number, a short description of the item, the purchase price of the item, and its current location (e.g.: room/building location). If an item is surplussed (e.g., gotten rid of), then the current location should say surplus, but the item should remain on the list. Write a program that reads inventory items from a file into a vector. Implement a menu system that allows the user to add, edit, and delete records from the list as well as search the list based on inventory number and print a report of all records. The list should always be maintained in order of inventory number. When the program closes, the data file should be overwritten with the most recent data from the list. Write a function for each option. Functions should be as listed. Name Return Type Description add int Function adds a new inventory item to the vector and returns the location where it was added. edit bool Allows the user to edit the values of an item. Returns true/false as an indication of success. remove bool Removes an item from the vector.Returns true/false as an indication of success. search int Locates an item in the vector by the inventory items. print void Prints either a specific item or all items in the vector. Sample Output 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Selction: 4 Inventory Number: 14-4343-41 Item found. 14-4343-41 Cabinet 175.00 AW-212 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Selction: 2 Inventory Number to edit: 14-4343-41 Editing 14-4343-41 1 - Name 2 - Price 3 - Location 4 - Done Selection: 1 New Name: Cabinets Selection: 2 New Price: 278.00 Selection: 4 Updated Record: 14-4343-41 Cabinets 278.00 AW-212 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Selction: 3 Inventory Number to delete: 14-4343-41 Successfully deleted. 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Selction: 1 Inventory Number: 13-7889-77 Name: Server Price: 1290.99 Location: LK-980 Sucessfully added. 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Selection: 6
A college must track equipment items purchased using special funds.
Create a struct name Inventory that represents an equipment item. An equipment item consists of an 8-alphanumeric inventory number, a short description of the item, the purchase price of the item, and its current location (e.g.: room/building location). If an item is surplussed (e.g., gotten rid of), then the current location should say surplus, but the item should remain on the list.
Write a program that reads inventory items from a file into a
Write a function for each option. Functions should be as listed.
Name | Return Type | Description |
---|---|---|
add | int | Function adds a new inventory item to the vector and returns the location where it was added. |
edit | bool | Allows the user to edit the values of an item. Returns true/false as an indication of success. |
remove | bool | Removes an item from the vector.Returns true/false as an indication of success. |
search | int | Locates an item in the vector by the inventory items. |
void | Prints either a specific item or all items in the vector. |
Sample Output
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images