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.

This program must be in C. Not C ++. Next write a

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

program that lets you work with the data concerning each tool, enables

Adding records to the data file

you to list all your tools, lets you delete a record for

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

a tool that you no longer have and lets you update any

Verify the record was updated correctly

information in the file. The tool identification number should be the record

Adding a dummy record to be deleted later

number. Use the following information for your program to work with. Use

Verify its there

the example code shown in of the text book to complete your

Now delete it.

assignment. Use one word tool name when working with tool name. If

Verify its no longer there

a space is detected in the input, scanf will ignore the remaining

Writing tool records to a text file

input. Instead of Electric sander, use Electric.sander or Electric_sander. If you really

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!