+1(316)4441378

+44-141-628-6690

C Program needed

[prob1.c][100%] Develop a C program to read hurricane data and store and sort those hurricane data.
Each hurricane record contains the hurricanes name, year, month, and category. An input file named
hurricane.txt contains 100 hurricane records. Your program will perform the following tasks.
a) Read hurricane data from input file hurricane.txt and store them in an array of structure. The
structure definition is shown below. Then write the hurricane data stored in the array of structure
to a binary file named hurricane.bin.
typedef struct hurricane
{
char name[20];
int year;
int month;
int category;
}H_RECORD;
b) Create a new structure for storing the same hurricane data. This new structure should contain the
same members (name, year, month, and category) but utilize a minimum size as a data type.
Take the definition of the new structure shown below as an example. Design this new structure
so that the value sizeof(H_RECORD_MIN) is minimized. Read hurricane data from input file
hurricane.txt, store them in an array of this new structure, and write the hurricane data stored
in the array of new structure to a binary file named hurricane_min.bin.
typedef struct hurricane_min
{

}H_RECORD_MIN;
[Hint: examine the range required for each member and modify their data type/size.]
c) Display on the screen the file sizes of hurricane.txt, hurricane.bin, and hurricane_min.bin.
[Hint: you can use fseek() and ftell().]
d) Read hurricane from input file hurricane.txt, store them in an array of structure, sort the
hurricane data by its category from minimum to maximum, and write the sorted hurricane data to
a text file named hurricane_sort.txt. In the output file hurricane_sort.txt, category-1
hurricanes will appear first, then category-2 hurricanes, category-3 hurricanes, and so on.
A template source code is provided. In the template, the main() function first calls Setup() to
generate the input file named hurricane.txt. Then the main() function calls DisplayMax()
that displays on the screen all hurricanes of maximum category. Then the main() function calls the
following four functions (in order):
SaveBinFile() performing task a), generating hurricane.bin
SaveBinFileMin() performing task b), generating hurricane_min.bin
DisplayFileSize() performing task c), accessing hurricane.txt, hurricane.bin,
hurricane_min.bin
SaveSortTxt() performing task d), generating hurricane_sort.txt
The template compiles correctly with warnings of unused variables, which should disappear once
you use those variables in your code. The flow of the program and the input and output file names
are all set up properly. DisplayMax() provides an example of reading hurricane records and
storing them in an array of structure. You can complete this program by filling the blanks inside
the function definitions. Only insert your code inside the definitions of aforementioned four
functions. No modifications should be done to any other part of the template source code.
In your report, describe in detail what your functions do and your implementation details. You can also
include your source code in your report in case your source code submission on Blackboard encountered
unexpected difficulties. However, you must submit your source code file (.c), not just Word or PDF
document containing the source code

I also have examples of what the outputs should look like that I will send after I choose one

 

You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.

 

Latest completed orders:

# topic title discipline academic level pages delivered
6
Writer's choice
Business
University
2
1 hour 32 min
7
Wise Approach to
Philosophy
College
2
2 hours 19 min
8
1980's and 1990
History
College
3
2 hours 20 min
9
pick the best topic
Finance
School
2
2 hours 27 min
10
finance for leisure
Finance
University
12
2 hours 36 min
[order_calculator]