Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this activity you will create a program, in C, for a clothing store. A linked list of nodes was created using an input file

In this activity you will create a program, in C, for a clothing store. A linked list of nodes was created using an input file from argv[1], from the command line, now your job is to input the linked list information into a file given by the user in the command line, argv[2]. The file you have to write has to have the item name, the department where the item is stocked, the item number, the original price, the sale price, and the quantity of the item. An example of the output file:

Purple shirt Shirts 43820 42.5 31.98 300 Black pants Pants 38940 90.23 51.99 129 Red shirt Shirts 53620 45.5 38.98 274

The linked list structure with nodes used to write the input file is :

struct Cost{ float originalPrice; float retailPrice; int quantity; }; struct Data{ char item[45]; char department[25]; int itemNumber; struct Cost pricing; };

typedef struct Node{ struct Data clothing_item; struct Node *next; } Node;

The input and the output file are the same. This program gets the input file and transforms it into a linked list(already done it), and then it uses the linked list to write the output file(needs to be done).

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

More Books

Students also viewed these Databases questions