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. FAST,
  20. WET_FAST,
  21. GOOD,
  22. SLOW,
  23. MUDDY,
  24. SLOPPY,
  25. SEALED,
  26. FIRM,
  27. YIELDING,
  28. SOFT,
  29. HEAVY
  30. };
  31.  
  32. // enumerated type for horse gender
  33. enum horse_gender
  34. {
  35. GELDING,
  36. COLT,
  37. FILLY,
  38. MARE,
  39. RIG
  40. };
  41.  
  42. // enumerated type for race type
  43. enum race_type
  44. {
  45. MDN,
  46. MSW,
  47. CLM,
  48. ALW,
  49. STA,
  50. STR,
  51. CST,
  52. MOC,
  53. INV,
  54. TRL,
  55. STK,
  56. MCL,
  57. OCL,
  58. AOC,
  59. HCP,
  60. SHP,
  61. SOC,
  62. MST,
  63. DBY,
  64. FTR
  65. };
  66.  
  67. // enumerated type for horse color
  68. enum horse_color
  69. {
  70. B,
  71. BL,
  72. BR,
  73. CH,
  74. GR,
  75. RO,
  76. WH
  77. };
  78.  
  79. // enumerated type for distance
  80. enum distance
  81. {
  82. SPRINT,
  83. MIDDLE,
  84. LONG
  85. };
  86.  
  87. // supporting date structure
  88. struct date
  89. {
  90. int month;
  91. int day;
  92. int year;
  93. };
  94.  
  95. //supporting time structure
  96. struct time
  97. {
  98. int hour;
  99. int minute;
  100. };
  101.  
  102. //supporting race time structure
  103. struct race_time
  104. {
  105. int minute;
  106. float second;
  107. };
  108.  
  109.  
  110. // supporting race performance structure
  111. struct performance
  112. {
  113. int starts;
  114. int wins;
  115. int places;
  116. int shows;
  117. float earnings;
  118. };
  119.  
  120. //supporting totals structure
  121. struct totals
  122. {
  123. struct performance currentYearTotals;
  124. struct performance previousYearTotals;
  125. struct performance LifetimeTotals;
  126. struct performance trackTotals;
  127. struct performance dirtTotals;
  128. struct performance wetDirtTotals;
  129. struct performance allWeatherTotals;
  130. struct performance atDistanceTotals;
  131. };
  132.  
  133.  
  134. // supporting jockey structure
  135. struct jockey
  136. {
  137. char jockeyName[MAX_STRING];
  138. float jockeyWeight;
  139. struct performance record;
  140.  
  141. };
  142.  
  143. //supporting owner structure
  144. struct owner
  145. {
  146. char ownerName[MAX_STRING];
  147. char silks[MAX_STRING];
  148. };
  149.  
  150. //supporting trainer structure
  151. struct trainer
  152. {
  153. char trainerName[MAX_STRING];
  154. struct performance record;
  155. };
  156.  
  157. //supporting horse structure
  158. struct horse
  159. {
  160. char horseName[MAX_STRING]; // horse name
  161. enum horse_gender horseGender; // horse gender
  162. struct owner horseOwner;
  163. struct trainer horseTrainer;
  164. int horseAge; // horse age
  165. enum horse_color horseColor;
  166. char sireName[MAX_STRING]; // horse's Sire's name
  167. char damName[MAX_STRING]; // horse's Dam's name
  168. int daysUnraced;
  169. struct totals raceTotals;
  170. };
  171.  
  172. //supporting race condition structure
  173. struct race_condition
  174. {
  175. int purse;
  176. char raceDescription[MAX_STRING];
  177. int ageRestriction;
  178. int weightAssignment;
  179. char claimingCondition[MAX_STRING];
  180. int raceDistance;
  181.  
  182. };
  183.  
  184. //supporting track record holder structure
  185. struct track_record_holder
  186. {
  187. char horseName[MAX_STRING]; // horse name
  188. int horseAge; // horse age at time of race
  189. float weightCarried; // weight carried by horse at time of recored
  190. struct race_time recordTime; //record time
  191. struct performance record; // past performance record
  192. };
  193.  
  194.  
  195. struct claiming_information
  196. {
  197. char newOwnerName[MAX_STRING];
  198. char previousOwnerName[MAX_STRING];
  199. char formerTrainerName[MAX_STRING];
  200. float claimingPrice;
  201. };
  202.  
  203.  
  204.  
  205.  
  206. // structure to store details on each race
  207. struct race_details
  208. {
  209. struct date raceDate; //date of the race
  210. struct time raceTime; //time of the race
  211. char wagersAvailable[MAX_STRING]; //shows the type of wager you can use to bet in that specific race including the exotic bets
  212. int raceNumber; //race number
  213. char trackName[MAX_STRING]; // track name
  214. int raceRating; //estimate of what the winner of today’s race will earn for an Equibase Speed Figure
  215. enum race_type raceType; // what type of race is the event about
  216. enum surface raceSurface; // dirt, turf, synthetic
  217. enum track_condition condition; // track condition
  218. struct race_condition raceCondition; //includes the purse, detailed description of the race, age restriction/condition, weight assignments, claiming condition and distance of the race.
  219. 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.
  220.  
  221. };
  222.  
  223. // add a structure to store details on each horse
  224. struct horse_details_and_past_performance
  225. {
  226. int programNumber; // program number
  227. char saddleClothColor[MAX_STRING];
  228. float morningLineOdds; // morning line odds
  229. struct horse raceHorse;
  230. 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
  231. float weightCarried; // assigned weight
  232. struct jockey horseJockey; // jockey information
  233. int horseClassFigure;
  234. int lastSpeedFigure;
  235. char trackCode[3];
  236. int raceNumber;
  237. enum track_condition trackCondition;
  238. enum surface trackSurface; // dirt, turf, synthetic
  239. enum distance raceDistance;
  240. struct race_time fractionalTimes[FRACTIONS];
  241. int paceFigure;
  242. int postPosition;
  243. int finalPosition;
  244. float finalOdds;
  245. char shortFootnotes[MAX_STRING];
  246. struct claiming_information claimInfo;
  247. char workoutLines[MAX_STRING];
  248. char fillieRestricted;
  249. char stateBredRestricted;
  250. int fieldSize;
  251.  
  252.  
  253. };
  254.  
  255. // **************************************************
  256. // Function: main
  257. //
  258. // Description: declares arrays of race and horse
  259. // structures to test that the code compiles
  260. //
  261. // Parameters: none
  262. //
  263. // Returns: 0
  264. //
  265. // **************************************************
  266.  
  267. int main()
  268. {
  269. // NOTE: You do not have to populate these
  270. struct race_details myRaces[MAX_RACES];
  271. struct horse_details_and_past_performance myHorses[MAX_HORSES];
  272.  
  273. return 0;
  274. }
  275.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty