Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need a C program. 1 The Problem Youve been hired by a company that sells plumbing accessories. They have a data problem, because data that

Need a C program.

1 The Problem

Youve been hired by a company that sells plumbing accessories. They have a data problem, because data that gets entered by their salespeople doesnt necessarily come back out in the reports to the managers. Your job is essentially to compare two files and report whats missing.

2 The Data

When salespeople enter data into the system, they create a text file that gets read in by a program. The text file consists of a bunch of rows of text, broken up into columns, like this:

N106 AX350N 2 31.99 N251 AX299 4 24.99 N1402 AV2814 10 3.49 N210 AX299 6 24.99 

In this file, the first column is a customers ID number. Each customer has a unique ID. The second column is a part number; note that the second and fourth customer in that file ordered the same part. The third column is the amount of items in the order, and the last column is the unit price.

Note that there may be several entries per customer, and possibly even repeated orders. Note also that there will not necessarily be any discernible order to the entries in this file.

3 The Report

When the managers receive a report from the computer, it looks like this:

Govan, Guthrie (N210) AX299 x 6 $149.94 Mustaine, Dave (N106) AX350N x 2 $63.98 Van Halen, Edward (N1402) AV2814 x 10 $34.90 

Note that there is no record of customer N251s order. Note also that entries are reported in order by customers name, which you may or may not find helpful.

4 The Goal

Your goal in this project is to read the two files from disk they will be called data.txt and report.txt and display to standard output those files in data.txt that dont have a corresponding record in report.txt.

5 Your Program

The C program you submit must confirm to the following:

You must determine (and use) some way to store the pertinent information about an order. Need struct to store records. This type of storage, and prototypes for the functions that will directly manipulate variables of this type, must appear in the file record.h.

You must write the functions that manipulate the data in a file called record.c.

You must have an application that reads the files, performs the comparisons, and displays the results.

This application must appear in a file called project2.c.

You must have a Makefile, called Makefile, that compiles only the necessary parts of your program,

into an executable called project2.

Your application must be able to handle an indeterminate amount of text from both input files.

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

Without a calculator, find the exact function value. csc 45

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago