You work in a pawn shop that gets in shipments of jewelry. Each shipment is kept in a file (see below for a sample file) and contains the type of jewelry, the stone in the piece of jewelry and whether it is real or fake. Create a function that prints to screen certain information about the shipment and returns the number of a specific number of items (based on the arguments-see sample runs)
File: jewelry1.txt ring diamond real necklace diamond real ring sapphire fake bracelet ruby fake bracelet diamond fake Sample runs: printf("%d\\",get_available_items("jewelry1.txt","stone")); (base) Computers-MacBook Air! computers .la.out I see that -stone- is important in this shipment. Any specific stone to count? diamond OK. I will keep count of the number of the following that I find: diamond --diamond print out all stones --diamond - - Sapphire --ruby --diamond -ruby returns 3 since there are 4 diamonds printf("%d\\",get_available_items("jewelry1.txt", "type")); (base) Computers-MacBook Air:C computers ./a.out I see that -type- is important in this shipment Any specific type to count? ring Ok. I will keep count of the number of the following that I find: ring ring print out all types --necklace -ring --bracelet --bracelet --ring 3 returns 3 since there are 3 rings printf("%d\\",get_available items("jewelry1.txt", "authentic")); (base) Computers - MacBook Air:C computers .la.out I see that -authentic. is important in this shipment. Any specific authentic to count? fake Ok. I will keep count of the number of the following that I find: fake - real print out all real/fake - real - fake - fake --fake fake returns 4 since there are 4 fakes printf("%d\\",get_available_items("jewelry1.txt","cookie")); (base) Computers-MacBook Air:C computers ./a.out Unknown parameter to check...-1 you have to pass one of the following: type. Stone, authentic