Question: 3. Create a program that parses a CSV file of product data and loads the items into a struct with the following members: ID Name


3. Create a program that parses a CSV file of product data and loads the items into a struct with the following members: ID Name Price Quantity Additional Requirements Use file prices.csv for an example of what the input data will look like. Your program should take two arguments: an input file to process and a price limit. Print only the names of each item to stdout that have a price less than or equal to the given limit. If an item has 0 stock, indicated by quantity, do not print it out. If the given file does not exist or cannot be opened, warn the user by printing "CANNOT OPEN FILE." to stdout. Save your code as price_check.c. Example Run $ ./a.out prices.csv 199.99 MSI X470 Gaming Plus Corsair DDR4 Memory prices - Notepad File Edit Format View Help 1000, Intel Core i7-10700K, 399.99,10 1001, Intel Core i7-9700K, 479.98,5 1002, Intel Core i7-4790K, 294.98,21 1003, Intel Core i7-9800X,654.31,1 1100, AMD Ryzen 9 3900XT,498.99,11 1101, AMD Ryzen 5 3600XT, 249.99,15 2000,MSI X470 Gaming Plus, 124.99,13 2100, ASUS ROG Strix B550-E, 279.99,7 3000, MSI GeForce RTX 3080,759.99,0 3001,MSI GeForce RTX 3090,1549.99,0 4000, Corsair Vengeance RGB Pro 16GB, 87.99,4 4100, G.SKILL Ripjaws V Series 32GB, 113.99,8 4101, G.SKILL TridentZ RGB Series 32GB, 134.99,3 4200, Patriot Viper Steel 16GB, 149.99,1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
