#include <stdio.h>
#define MAX_NAME 50
#define MAX_RACES 10
#define MAX_HORSES 20
// supporting date structure
struct date
{
int month;
int day;
int year;
};
// supporting time structure
struct race_time
{
int hour;
int minute;
};
// enumerated type for race surface
enum race_surface
{
DIRT,
TURF,
SYNTHETIC
};
// enumerated type for track condition
enum track_condition
{
FAST,
GOOD,
MUDDY,
SLOPPY,
FIRM,
SOFT
};
// enumerated type for horse gender
enum horse_gender
{
MALE,
FEMALE,
GELDING
};
// supporting money structure
struct money
{
float amount;
};
// supporting odds structure
struct odds
{
int numerator;
int denominator;
};
// supporting jockey structure
struct jockey
{
char jockeyName[MAX_NAME];
float jockeyWeight;
};
// supporting trainer structure
struct trainer
{
char trainerName[MAX_NAME];
};
// supporting owner structure
struct owner
{
char ownerName[MAX_NAME];
};
// supporting race record structure
struct past_performance
{
int starts;
int wins;
int places;
int shows;
float earnings;
};
// add a structure to store details on each race
struct race_details
{
struct date raceDate; // A - date of the race
struct race_time postTime; // B - race time
int raceNumber; // C - race number
char trackName[MAX_NAME]; // E - track name
float distance; // race distance
enum race_surface surface; // dirt, turf, synthetic
enum track_condition condition; // track condition
struct money purse; // purse/prize money
int numberOfHorses; // number of horses entered
int ageRequirement; // age requirement for horses
char raceType[50]; // claiming, allowance, stakes, etc.
};
// add a structure to store details on each horse
struct horse_details_and_past_performance
{
int programNumber; // 1 - program number
int postPosition; // post position
char horseName[MAX_NAME]; // 8 - horse name
enum horse_gender horseGender; // 10 - horse gender
int horseAge; // horse age
float weightCarried; // assigned weight
struct jockey horseJockey; // jockey information
struct trainer horseTrainer; // trainer information
struct owner horseOwner; // owner information
struct odds morningLineOdds; // morning line odds
struct past_performance record; // past performance record
int lastRaceFinish; // last finish position
float speedRating; // speed rating
float earningsThisYear; // yearly earnings
};
// **************************************************
// Function: main
//
// Description: declares arrays of race and horse
// structures to test that the code compiles
//
// Parameters: none
//
// Returns: 0
//
// **************************************************
int main()
{
// NOTE: You do not have to populate these
struct race_details myRaces[MAX_RACES];
struct horse_details_and_past_performance myHorses[MAX_HORSES];
return 0;
}