Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description: C program (NOT C++) A grocery store wants to keep a database of the items they sell. You will write 2 programs. One program

Description: C program (NOT C++)

A grocery store wants to keep a database of the items they sell. You will write 2 programs. One program will read in (from a text file) the current items they sell and save those items to a binary file. The second program will read in the binary file and provide a user interface to allow for adding items, providing the number of items in a particular category and for listing the contents of the file by category to the screen. The information for each item (no more than 100 items) will be name of item (no more than 20 characters), the cost of the item in cents, aisle number and a character representing the product category (M for meats, P for produce, D for dairy, and C for canned foods). The following is an example line from the text file: Corn 89 3 C Required You must store each item in a structure. There must be only 1 binary file. Your input will be the file grocery.txt in /home/public.

The user interface (for the second program) will be: Select option (A-add item, N-number of items in category, L-list all items, X-exit pgmZZ):

(If A is selected) Enter name of item to add: Enter price: Enter aisle: Enter category: (If N is selected) Enter category to print: (And then print-) There are number of items in the Canned Goods category (If L is selected) (Print all items by category.

For example?

Canned Goods Corn, price: 89 cents, Aisle: 1

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

Step: 3

blur-text-image

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

1 What are the three key facets of HRP?

Answered: 1 week ago