#include #include /* the ranks of academic staff. */ typedef enum { Lecturer, SeniorLecturer, Reader, Professor } Rank; /* struct giving the rank of a member of staff, together with their year of appointment to the rank. In the case of Senior Lecturers, their year of appointment as Lecturer is used */ typedef struct { Rank rank; int year; /* year of appointment */ } staff; /* Complete this function as specified in the question */ int precedes(staff s1, staff s2) { /* BEGIN ANSWER -- do not delete this line */ // ADD YOUR CODE HERE /* END ANSWER -- do not delete this line */ } int main(void) { staff s1 = { Professor, 2010 }; staff s2 = { Lecturer, 1991 }; printf("Checking that young prof precedes old lecturer: %d\n", precedes(s1,s2)); s2.rank = Professor; printf("Checking that young prof is preceded by old prof: %d\n", precedes(s1,s2)); s1.rank = SeniorLecturer; s2.rank = Lecturer; s1.year = s2.year = 2000; printf("Checking that lect and senior lect are equal: %d\n", precedes(s1,s2)); }