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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!