Question: Write a C code that meets the following requirements: Below is the outline code from excerise A: /*------------------------------------------------------------------ File: analyseBinFile.c Author: Description: Reads the contents
Write a C code that meets the following requirements:
Below is the outline code from excerise A:
/*------------------------------------------------------------------ File: analyseBinFile.c Author: Description: Reads the contents of a bin file and analyses the data. ---------------------------------------------------------------------*/ #include
}
And below is the exact output required:
and below is the data: 
B. Exercise: Reading data from a Binary File (20 marks) The project available in the zip file analyseBinFile.zip is practically a duplicate of the program in Exercise A. In this case the data is read from a binary file. Your task in this exercise is to complete the function analyseBinFile so that program produces the same output as in Exercise A, but in reading from the binary file. There are two approaches that can be taken to read the contents of the binary file It is possible to read each value one at a time as in Exercise A. The code from Exercise A can easily be modified it so that the program runs and produces the expected result. Only how values are read from the file (see the course notes on reading from binary files) need be changed. Complete this exercise at home. .The other approach is to read in all values at once into an array (examine the function saveInBinFile from Exercise A to see how a complete array was written into the file). This is thoe version you must produce. Thus modify your code to read in the complete contents of the file (you may use NUM_VALUES as the number of values to be read). This approach illustrates how large amounts of data can be written to and read from binary files without any translations. This is quite practical when storing a large array or a large structure variable, even an array of structure variables. Show and explain to your TA your code and running program to get your marks B. Exercise: Reading data from a Binary File (20 marks) The project available in the zip file analyseBinFile.zip is practically a duplicate of the program in Exercise A. In this case the data is read from a binary file. Your task in this exercise is to complete the function analyseBinFile so that program produces the same output as in Exercise A, but in reading from the binary file. There are two approaches that can be taken to read the contents of the binary file It is possible to read each value one at a time as in Exercise A. The code from Exercise A can easily be modified it so that the program runs and produces the expected result. Only how values are read from the file (see the course notes on reading from binary files) need be changed. Complete this exercise at home. .The other approach is to read in all values at once into an array (examine the function saveInBinFile from Exercise A to see how a complete array was written into the file). This is thoe version you must produce. Thus modify your code to read in the complete contents of the file (you may use NUM_VALUES as the number of values to be read). This approach illustrates how large amounts of data can be written to and read from binary files without any translations. This is quite practical when storing a large array or a large structure variable, even an array of structure variables. Show and explain to your TA your code and running program to get your marks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
