Simple C exercise with read and write file
Budget: $10 – $30 USD
Make a C program that reads a text file called requests.txt, where
each line has a part number, number of orders, and quantities.
requested for the orders (the number of quantities is defined by the number
of orders). The system should produce a file called shopping.txt with the
part number and quantity to be purchased for products that do not
have enough stock to fill orders. The stock of each product
is stored in the text file called stock.txt, where each line has the
part number and current stock.
The order of the items must follow the order in which the parts appear in the file.
requests.txt.
- For reading and writing text files, use only the fscanf() and
fprintf().
each line has a part number, number of orders, and quantities.
requested for the orders (the number of quantities is defined by the number
of orders). The system should produce a file called shopping.txt with the
part number and quantity to be purchased for products that do not
have enough stock to fill orders. The stock of each product
is stored in the text file called stock.txt, where each line has the
part number and current stock.
The order of the items must follow the order in which the parts appear in the file.
requests.txt.
- For reading and writing text files, use only the fscanf() and
fprintf().
Related categories:
C Programming