Professional Documents
Culture Documents
Tutorial 8 2 Skeleton.c
Tutorial 8 2 Skeleton.c
h>
#include <stdlib.h>
#include <string.h>
int main()
{
Person *arrayOfPersons;
int size;
char name[MAX_SIZE_NAME];
Date birthday;
do
{
printf("Give number of persons you want to process: ");
scanf("%d", &size);
if (size <= 0)
{
printf("You have to give a positive number of persons. Try
again.\n");
}
} while (size <= 0);
readPersons(arrayOfPersons, size);
//εύρεση του ή των ατόμων με την ίδια ημερομηνία γέννησης που δίνει ο
χρήστης
printf("\nGive the date (DD/MM/YYYY) to find persons born on that
date: ");
scanf("%d/%d/%d", &birthday.day, &birthday.month, &birthday.year);
return 0;
}
// It returns only the first person found with the oldest age. Consider
the extension to return all oldest persons.
void findOldest(Person *persons, int size, char *name, Date *birthday)
{
...
}
//εναλλακτική υλοποίηση της συνάρτησης για την εύρεση του πλήθους των
ατόμων και του ΜΟ των υψών τους ανά μήνα
void countPersonsAverageHeightPerMonth2(Person *persons, int size)
{
int i, j;
float sum;
int count;