#include <stdio.h>
/************************************************************
* Question 8 – Horse Racing Program Structures (C ONLY)
************************************************************/
/* ------------------ Macros ------------------ */
#define MAX_NAME_LEN 50
#define MAX_JOCKEY_LEN 50
#define MAX_TRAINER_LEN 50
#define MAX_TRACK_LEN 50
#define MAX_HORSES 20
/* ------------------ Enumerations ------------------ */
typedef enum
{
MALE,
FEMALE,
GELDING
} HorseGender;
typedef enum
{
FAST,
GOOD,
MUDDY,
SLOPPY
} TrackCondition;
/* ------------------ Supporting Structures ------------------ */
typedef struct
{
int month;
int day;
int year;
} date;
typedef struct
{
int wins;
int places;
int shows;
int totalStarts;
} performance_stats;
typedef struct
{
char jockeyName[MAX_JOCKEY_LEN];
char trainerName[MAX_TRAINER_LEN];
} connections;
typedef struct
{
float odds;
int postPosition;
} betting_info;
/* ------------------ Horse Details & Past Performance ------------------ */
typedef struct
{
int programNumber; // 1
char horseName[MAX_NAME_LEN]; // 8
HorseGender gender; // 10
int age;
int weightCarried;
performance_stats pastPerformance;
connections team;
betting_info betting;
} horse_details_and_past_performance;
/* ------------------ Race Details ------------------ */
typedef struct
{
date raceDate; // A
int raceNumber; // C
char trackName[MAX_TRACK_LEN]; // E
float distance; // furlongs or miles
TrackCondition condition;
int purseAmount;
int numberOfHorses;
horse_details_and_past_performance horses[MAX_HORSES];
} race_details;
/* ------------------ Example Main (compile test only) ------------------ */
int main(void)
{
race_details myRaces[10];
/* No initialization required per instructions */
return 0;
}