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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY