Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C PROGRAMMING LANGUAGE: I'm writing a program that reads in a file, stores its information in linked list, and then finds the oldest person

IN C PROGRAMMING LANGUAGE:

I'm writing a program that reads in a file, stores its information in linked list, and then finds the oldest person in the list, the youngest person in the list, and the amount of birthdays in each month.

As of right now, I have everything working except my function to find the oldest and youngest person.

My structs are typedef struct birthday { int day; int year; char month[50]; } birthday_t; typedef struct node { char firstName[50]; char lastName[50]; birthday_t birthday; char major[50]; char standing[50]; struct node *next; } node_t; typedef struct stats { node_t* oldestPerson; node_t* youngestPerson; int numBirthdays[12]; } list_stats_t; THESE CANNOT BE CHANGED. Month in the birthday struct CANNOT BE AN INT. Please do not change the structs.

The function declaration is list_stats_t getListStats(node_t* head); this cannot be changed. The function must iterate through the linked list to find the oldest person and the youngest person using the information in the structs provided above. I've been working on this for a few hours and can't seem to get everything to calculate properly. The years, months and days must be compared to properly find the oldest and youngest person in the list. I'd appreciate it if someone could help me figure out a good implementation for this. :) Thank you!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

Which personal relationships influenced you the most?

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago