Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 2 Introduction to C CSCI 112, Spring 2018 Description A grocery store wants to keep a database of the items they sell. You will

image text in transcribed

Program 2 Introduction to C CSCI 112, Spring 2018 Description 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 ina 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): (lf 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_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

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions