Question: (IN C) Linked List from File & Birthday Statistics: TASK: list_stats_t getListStats(node_t *head); This function will take in a pointer to the head of your
(IN C) Linked List from File & Birthday Statistics:
TASK:
list_stats_t getListStats(node_t *head); This function will take in a pointer to the head of your list and return a populated list_stats struct.
This function should iterate through the linked list and find the oldest person in the list, the youngest person in the list, and the number of birthdays per month. All months will be spelled correctly and capitalized (January, February, March not january, february, march).
It is possible to get all these stats with one iteration of the list, however if you want to implement three separate helper functions, one for finding the oldest, one for finding the youngest, and one for counting the number of birthdays, that works as well. Just have your getListStats function call those helpers.
I recommend writing a compareBirthdays helper function that will take in two birthdays and determine which one is older and which is younger. This will help you keep getListStats from becoming too large and overwhelming.
void printStats(FILE* , list_stats_t *); This function will take in two parameters, a file pointer pointing at the output file to print to and a pointer to the struct containing your stats.
This function should print out your results like the following:

If the list is empty, print out None .
These functions are required but you are free to implement helper functions as you see fit. As long as the required functions (with the correct parameters and return values) are present, the implementation is flexible.
Make sure to remove all warnings from your code (compile with -Wall to view warnings). If your code has warnings when compiling, you will lose points.
Here is my linked list starter code (DO NOT MODIFY THE FUNCTIONS & STRUCTS THAT ARE ALREADY IMPLEMENTED)
driver.c

functions.h

functions.c



Here is an example txt file the program would read from
Smith,Bob,July,31,2002,CS/BS,Junior Doe,Jane,December,12,2003,CS/BS,Sophomore Doe,John,December,25,2007,CS/BS,Sophomore Joe,Average,February,3,2002,CS/BS,Freshman
Comments would be appreciated, thank you!
List Statistics: --.----oldest Person- Name: John Smith Date of Birth: May 11, 1993 Major: CS/BA Year: Senior --.-----Youngest Person- Name: Mary Baker Date of Birth: January 30, 2004 Major: CS/BA Year: Freshman --.-----Birthday Counts January: February: 4 March: 3 April: 2 May: 2 June: 2 July: 0 August: 3 September: 5 October: 1 November: 1 December: 0 * Or if you prefer the more pseudocode way of showing it: printBorder() Name: \t\%s \%s Date of Birth: \t\%s \%d, \%d Major: \t\%s \ n Year: \ t\%s Name: \t\%s \%s \ n Date of Birth: \t\%s \%d, \%d \, Major: \t\%s Year: \t\%s January: \# February: \# March: \# April: \# May: \# June: \# July: \# August: \# September: \# October: \# November: \# December: \#
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
