Question
C Program /*Please use comments to explain the code */ 1 Write a C program that will keep track of the number of goods in
C Program
/*Please use comments to explain the code */
1 Write a C program that will keep track of the number of goods in a warehouse for various goods. Each will be represented by a struct and contain the item number, the name and availability. The program should via a menu provide the opportunity to perform the following actions as long as the user wants:
1)Register new products
2) Print All products
3) Search for products
4) Change stock balance of goods
5) Sort products
6) Unregister goods 7
)Exit the program.
when the program is launched, the program will ask the user to enter a file and then the program will load the item number, name and balance from the file and save it in an array of struct. If the file is missing, the program will start with an empty array. When the program ends, it will overwrite / create a text file (not binary) with the previously specified name and where to save the struct in the array so that they can be loaded the next time the program is run.
Register new products
Here can we register new goods.
Print all goods
When the user selects this option prints all items in the program in the order they are stored in the program and then the main menu again.
Change the stock
Here the user gets first opportunity to do a search and then enter the item number for a particular item and if there is such a product to increase or decrease the balance of any variety. The user should be able to change the balance of so many goods they want and then exit and then return to the main menu. If a product is announced this program. If the user tries to reduce the balance below zero, the user receives a warning and the balance is reduced to zero. It is reasonable and desirable that the code search is organized in such a way that the same code can be reused here used in the search option above.
Sort products
Here you can choose to sort the goods by item number, name or balance. Depending on choice sorted items in the array stored in and the program returns to the main menu.
To see the results of the sort you get in the main menu, select to print all goods.
Unregister goods
Here the user gets the first opportunity to do a search and then be able to unregister a product of a given item number. This product is then completely removed from the register. The user can delete multiple items and then return to the main menu.
For Examp
Itemnumber name stocksum ______________________________________________ 003 carrot 14 005 banana 0 007 apple 32
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started