Question
using c statements, write a program that should ask the user with the following menu options: 1: Add a number of items into inventory. 2:
using c statements,
write a program that should ask the user with the following menu options:
1: Add a number of items into inventory. 2: Print current inventory contents. 3: Save current inventory contents to a file
4: Exit program.
An Item should be represented by a user-defined data type (struct). An Item has the following fields:
Item id
Item name
Item price
Item quantity
- If option 1 is selected:
your program should prompt the user for:
1.how many items they wish to enter, and this number should be used to allocate memory for a dynamic array of Items
2. prompt the user to input the three fields associated with each Item , and store the Items inside of the array.
-If option 2 is selected:
your program should:
1.print the contents of the array of Items that your program is internally maintaining, in a visibly pleasing way, to standard output.
- If option 3 is selected:
your program should:
1. print the contents of the array of Items that your program is internally maintaining, in a visibly pleasing way, to a file called inventory.txt .
- If option 4 is selected
your program should:
1. gracefully exit with a farewell message.
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