fork download
  1. #include <stdio.h>
  2.  
  3. #define MAX_STRING 50
  4. #define MAX_RACES 10
  5. #define MAX_HORSES 20
  6. #define FRACTIONS 4
  7.  
  8. // enumerated type for race surface
  9. enum surface
  10. {
  11. DIRT,
  12. TURF,
  13. SYNTHETIC
  14. };
  15.  
  16. // enumerated type for track condition
  17. enum track_condition
  18. {
  19. FST, //FAST
  20. FT, //FAST
  21. WF, //WET_FAST
  22. GD, //GOOD
  23. SL, //SLOW
  24. MUD, //MUDDY
  25. MY, //MUDDY
  26. SY, //SLOPPY
  27. FIRM, //FIRM
  28. FRM, //FIRM
  29. YLD, //YIELDING
  30. SF, //SOFT
  31. SFT, //SOFT
  32. HY, //HEAVY
  33. HVY //HEAVY
  34. };
  35.  
  36. // enumerated type for horse gender
  37. enum horse_gender
  38. {
  39. G, //GELDING
  40. C, //COLT
  41. F, //FILLY
  42. M, //MARE
  43. R //RIG
  44. };
  45.  
  46. // enumerated type for race type
  47. enum race_type
  48. {
  49. MDN, //Maiden special weight
  50. MSW, //Maiden special weight
  51. CLM, //Claiming
  52. ALW, //Allowance
  53. STA, //Starter Allowance
  54. STR, //Starter Allowance
  55. CST, //Claiming Stakes
  56. MOC, //Maiden Optional Claiming
  57. INV, //Invitational
  58. TRL, //Trials
  59. STK, //Stakes
  60. MCL, //Maiden Claiming
  61. OCL, //Allowance Optional Claiming
  62. AOC, //Allowance Optional Claiming
  63. HCP, //Handicap
  64. SHP, //Start Handicap
  65. SOC, //Starter Optional Claiming
  66. MST, //Maiden Stakes
  67. DBY, //Derby
  68. FTR //Futurity
  69. };
  70.  
  71. // enumerated type for horse color
  72. enum horse_color
  73. {
  74. B, //bay
  75. BL, //black
  76. BR, //brown
  77. CH, //chestnut
  78. GR, //grey
  79. RO, //roan
  80. WH //white
  81. };
  82.  
  83. // enumerated type for distance
  84. enum distance
  85. {
  86. SPRINT,
  87. MIDDLE,
  88. LONG
  89. };
  90.  
  91. // supporting date structure
  92. struct date
  93. {
  94. int month; //the month
  95. int day; //the day
  96. int year; //the year
  97. };
  98.  
  99. //supporting time structure
  100. struct time
  101. {
  102. int hour; //the hour
  103. int minute; //the minute
  104. };
  105.  
  106. //supporting race time structure
  107. struct race_time
  108. {
  109. int minute; //minutes
  110. float second; //seconds
  111. };
  112.  
  113.  
  114. // supporting race performance structure
  115. struct performance
  116. {
  117. int starts; //number of starts
  118. int wins; //number of wins
  119. int places; //number of places
  120. int shows; //number of shows
  121. float earnings; //total earnings
  122. };
  123.  
  124. //supporting totals structure
  125. struct totals
  126. {
  127. struct performance currentYearTotals; //this years performance
  128. struct performance previousYearTotals; //last years performance
  129. struct performance LifetimeTotals; //lifetime performance
  130. struct performance trackTotals; //track performance
  131. struct performance dirtTotals; //dirt track performance
  132. struct performance wetDirtTotals; //wet dirt track performance
  133. struct performance allWeatherTotals; //all weather performance
  134. struct performance atDistanceTotals; //performance at this distance
  135. };
  136.  
  137.  
  138. // supporting jockey structure
  139. struct jockey
  140. {
  141. char jockeyName[MAX_STRING]; //jockey's name
  142. float jockeyWeight; //jockey's weight
  143. struct performance record; //jockey's performance record
  144.  
  145. };
  146.  
  147. //supporting owner structure
  148. struct owner
  149. {
  150. char ownerName[MAX_STRING]; //owner's name
  151. char silks[MAX_STRING]; //silk information
  152. };
  153.  
  154. //supporting trainer structure
  155. struct trainer
  156. {
  157. char trainerName[MAX_STRING]; //trainer's name
  158. struct performance record; //trainer's performance record
  159. };
  160.  
  161. //supporting horse structure
  162. struct horse
  163. {
  164. char horseName[MAX_STRING]; // horse's name
  165. enum horse_gender horseGender; // horse's gender
  166. struct owner horseOwner; //horse's owner
  167. struct trainer horseTrainer; //horse's trainer
  168. int horseAge; // horse's age
  169. enum horse_color horseColor; //horse's color
  170. char sireName[MAX_STRING]; // horse's Sire's name
  171. char damName[MAX_STRING]; // horse's Dam's name
  172. int daysUnraced; //days since the horse last raced
  173. struct totals raceTotals; //horse's performance records
  174. int lastSpeedFigure; // horse’s last Official Equibase® Speed Figure
  175. };
  176.  
  177. //supporting race condition structure
  178. struct race_condition
  179. {
  180. int purse; //prize money of the race
  181. char raceDescription[MAX_STRING]; //detailed description of the race
  182. int ageRestriction; //age rextriction
  183. int weightAssignment; //weight assignment
  184. char claimingCondition[MAX_STRING]; //claim condition
  185. int raceDistance; //distance of the race
  186.  
  187. };
  188.  
  189. //supporting track record holder structure
  190. struct track_record_holder
  191. {
  192. char horseName[MAX_STRING]; // horse name
  193. int horseAge; // horse age at time of race
  194. float weightCarried; // weight carried by horse at time of recored
  195. struct race_time recordTime; //record time
  196. struct performance record; // past performance record
  197. };
  198.  
  199. //supporting struct for claiming information
  200. struct claiming_information
  201. {
  202. char newOwnerName[MAX_STRING]; //name of the new owner
  203. char previousOwnerName[MAX_STRING]; //name of the previous owner
  204. char formerTrainerName[MAX_STRING]; //name of the trainer
  205. float claimingPrice; //price for claiming
  206. };
  207.  
  208. // structure to store details on each race
  209. struct race_details
  210. {
  211. struct date raceDate; //date of the race
  212. struct time raceTime; //time of the race
  213. char wagersAvailable[MAX_STRING]; //shows the type of wager you can use to bet in that specific race including the exotic bets
  214. int raceNumber; //race number
  215. char trackName[MAX_STRING]; // track name
  216. int raceRating; //estimate of what the winner of today’s race will earn for an Equibase Speed Figure
  217. enum race_type raceType; // what type of race is the event about
  218. enum surface raceSurface; // dirt, turf, synthetic
  219. enum track_condition condition; // track condition
  220. struct race_condition raceCondition; //includes the purse, detailed description of the race, age restriction/condition, weight assignments, claiming condition and distance of the race.
  221. struct track_record_holder trackRecord; //contains the track record holder information including the horse’s name, his age, the weight carried and the time and the horse’s race record (wins, places, shows).This will reflect the record on the same surface at the same distance by the same breed type.
  222.  
  223. };
  224.  
  225. // add a structure to store details on each horse
  226. struct horse_details_and_past_performance
  227. {
  228. int programNumber; // program number
  229. char saddleClothColor[MAX_STRING]; //saddle color
  230. float morningLineOdds; // morning line odds
  231. struct horse raceHorse; //horse information
  232. char medicationAndEquipment[MAX_STRING]; //indicates the types of medication and equipment the horse will be using. Medication will always be listed with a capital letter
  233. float weightCarried; // assigned weight
  234. struct jockey horseJockey; // jockey information
  235. int horseClassFigure; //estimate of what that starter will earn for an Equibase Speed Figure (Thoroughbred) or speed rating (Quarter Horse and Arabian) in today’s race
  236. char trackCode[3]; //racetrack's acronym
  237. int raceNumber; //sequence of the race within the day
  238. enum track_condition trackCondition; //track condition
  239. enum surface trackSurface; // dirt, turf, synthetic
  240. enum distance raceDistance; //type of race sprint, middle, or long distance
  241. struct race_time fractionalTimes[FRACTIONS]; //times recorded at specific points or “fractions” of the race.
  242. enum race_type raceType; // what type of race is the event about
  243. int paceFigure; //the horse’s “speed figure” at the first call of the race
  244. int postPosition; //the actual physical position of the horse in the racetrack
  245. int finalPosition; //Final Position of the horse during each past race
  246. float finalOdds; //the win odds for the horse at the start time of the race
  247. char topThreeFinishers[MAX_STRING]; //the first three finishers of the race, followed by the weight that horse carried and then followed by margin
  248. char shortFootnotes[MAX_STRING]; //the chart comments listed for that horse in that race
  249. struct claiming_information claimInfo; //shows the new owner name, previous owner name, for a claiming price – Former Trainer
  250. char workoutLines[MAX_STRING]; //shows an insight into a horse’s fitness, conditioning, and readiness for upcoming races
  251. int ageRestriction; //age restriction
  252. char fillieRestricted; //Y/N means the specific race was restricted to fillies
  253. char stateBredRestricted; //Y/N meaning the specific race was restricted only to state bred horses
  254. int fieldSize; // the number of horses starting in the race
  255.  
  256.  
  257. };
  258.  
  259. // **************************************************
  260. // Function: main
  261. //
  262. // Description: declares arrays of race and horse
  263. // structures to test that the code compiles
  264. //
  265. // Parameters: none
  266. //
  267. // Returns: 0
  268. //
  269. // **************************************************
  270.  
  271. int main()
  272. {
  273. // NOTE: You do not have to populate these
  274. struct race_details myRaces[MAX_RACES];
  275. struct horse_details_and_past_performance myHorses[MAX_HORSES];
  276.  
  277. return 0;
  278. }
  279.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty