Question: This program must be in C. Not C ++. Next write a program that lets you work with the data concerning each tool, enables you
This program must be in C. Not C ++.
Next write a program that lets you work with the data concerning each tool, enables you to list all your tools, lets you delete a record for a tool that you no longer have and lets you update any information in the file. The tool identification number should be the record number. Use the following information for your program to work with.

Use the example code shown in of the text book to complete your assignment. Use one word tool name when working with tool name. If a space is detected in the input, scanf will ignore the remaining input. Instead of Electric sander, use Electric.sander or Electric_sander. If you really want to capture multi word tool name, then you have to use gets function to capture the entire input and the parse out the name, quantity and cost on your own. When you run the program the first time, no tool record will be available. You have to use option 3, 8 times to enter the above 8 records into the data file. Sample input / output

Adding records to the data file

(Hammer2 was purposely entered incorrectly, so option 2 can be used to update it.) Updating a record

Verify the record was updated correctly

Adding a dummy record to be deleted later

Verify its there

Now delete it.

Verify its no longer there

Writing tool records to a text file

Question : what is the difference between hardware.dat and hardware.txt. The hardware.dat file is operated using fwrite and fread without any %d,%f etc formatter, which means the actual data in the file is the raw binary value. For example 1 would in the data file as 00000000 (the binary value of 1). The binary value of 1 is not printable and that is why you will not able to see it if you view the hardware.dat. The output for hardware.txt was created using fprintf which generates pretty format for output using %d, %f %s. The pretty format is what allows you to see the data. The hardware.txt will only be updated when you use option 1 regardless of changes made to hardware.dat.
Record # Tool name Quantity Cost Electric sander 7 Hammer Jig saw Lawn mower Power saw Screwdriver Sledge hammer Wrench 57.98 11.99 11.00 79.50 99.99 6.99 21.50 7.50 76 21 17 24 39 56 68 18 106 83 34
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
