Question: In this assignment you'll write a program to illustrate how Linked list and structure are used in practice, we'll develop a program that maintains a


In this assignment you'll write a program to illustrate how Linked list and structure are used in practice, we'll develop a program that maintains a database of information about parts stored in a warehouse. The program is built around the database stored in linked list and structures, with each structure containing information - part number, name, and quantity about one part. The program tracks parts stored in a warehouse. Contents of each structure: Part number Name Quantity Your program should do the following: 1. Add a new part number, part name, and initial quantity on hand (Inserting a node) 2. Given a part number, print the name of the part and the current quantity on hand (search or find) 3. Given a part number, change the quantity on hand (update) 4. Display all information in the database (print) 5. Terminate program execution (quit) The codes i (insert), s (search or find), u (update), p (print), and q (quit) should be used to represent these operations Inventory should point to the first node in the list: struct part *inventory = NULL; . The part structure should contain a pointer to the next node: struct part { int number; char name[NAME_LEN+1]; int on hand; struct part *next; }; Keep the nodes in the inventory list sorted by part number. find part should return a pointer to the node that contains the desired part number. If it doesn't find the part number, find_part should return a null pointer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
