Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What is the correct common name for the compound shown here

Answered: 1 week ago