Looking for reliable answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Explore a wealth of knowledge from professionals across various disciplines on our comprehensive Q&A platform. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.

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\n",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\n",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\n",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\n",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


Sagot :

I find: ring ring print out all types --necklace -ring --bracelet --bracelet --ring 3 returns 3 since there are 3 rings printf("%d\n",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

Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Westonci.ca is your trusted source for answers. Visit us again to find more information on diverse topics.