fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // Add supporting structures - expect many structure types
  5. // here ...
  6.  
  7. typedef struct // part of A
  8. {
  9. int month;
  10. int day;
  11. int year;
  12. } date;
  13.  
  14. // TODO - add other supporting structures that could be
  15.  
  16. typedef struct // part of A
  17. {
  18. int hour;
  19. int minute;
  20. } raceTime;
  21.  
  22. typedef struct // J
  23. {
  24. int purse;
  25. char escridption[200];
  26. char ageRestriction[30];
  27. char weightAssignments[30];
  28. char claimingCondition[50];
  29. char distance[50];
  30. } condition;
  31.  
  32.  
  33. typedef struct // K
  34. {
  35. char name[50];
  36. int age;
  37. int weight;
  38. raceTime recordTime;
  39. date recordDate;
  40. } record;
  41.  
  42. typedef struct // 5-6
  43. {
  44. char owner[50]; // owner of the horse
  45. char silks[20]; // colorful jackets worn by jockeys to identify owner
  46. char trainer[50]; // trainer of the horse
  47. char trainerStats[50]; // trainer stats showing the starts, wins, places and shows
  48. } OT_info; // owner and trainer info
  49.  
  50. typedef struct // 9
  51. {
  52. char medication[3];
  53. char equipment[3];
  54. } ME_info;
  55.  
  56. typedef struct // 10 - 11
  57. {
  58. char horseColor[10];
  59. char horseGender[5];
  60. int horseAge;
  61. char horseSire[50]; // horse's father
  62. char horseDam[50]; // horse's mother
  63. int carriedWeight; // total weight including jocket, saddle, etc.
  64. } bio_info;
  65.  
  66. typedef struct // 12
  67. {
  68. char name[50];
  69. int experienceYears;
  70. int starts; // jackey stats
  71. int wins;
  72. int places;
  73. int shows;
  74. } jockey;
  75.  
  76. typedef struct
  77. {
  78. record recordOnTrack; // record of horse on same surface as today's track
  79. record recordOnDirt; // record of horse on dirt
  80. record recordOnWetDirt; // record of horse on wet dirt
  81. record recordOnAllWeather; // record of horse all weather
  82. int winningHorseNumber; // 1st place horse number for the race
  83. int placeHorseNumber; // 2nd place horse number for the race
  84. int showHorseNumber; // 3rd place horse number for the race
  85. int speedFigure; // official equibase speed figuer
  86. int earnings; // earnings in every category
  87. } totals;
  88.  
  89. typedef struct // 18
  90. {
  91. char dirtTrack[20]; // condition of the dirt track
  92. char turfTrack[20]; // condition of the turf track
  93. } trackCondition;
  94.  
  95. typedef struct // 18-23
  96. {
  97. trackCondition trackConditions; // 18
  98. char raceDistance[10]; // tells type of race (20)
  99. int daysUnraced; // days between races that the horse is unraced (21)
  100. float fractionalTimes; // times recorded at specific points of the race (22)
  101. char ageLimit[5]; // age limit (23)
  102. char horseRestrictions[3]; // 24-25
  103. char raceType[10]; // what type of race the event is about
  104. } raceCondition;
  105.  
  106. typedef struct // 29-31
  107. {
  108. int postPosition; // specific starting gate or stall assigned to horse
  109. char calls[20]; // specific points during a race where a horse's position is recorded
  110. char finalPosition[20]; // final position during each past race
  111. } positions;
  112.  
  113. typedef struct /// 36 - top three finishers of the race followed by weight followed by margin
  114. {
  115. char firstFinisher[50];
  116. char secondFinisher[50];
  117. char thirdFinisher[50];
  118. } topThreeFinishers;
  119.  
  120. typedef struct // 40
  121. {
  122. date workoutDate;
  123. char racetrack[30];
  124. trackCondition workoutTrackCondition;
  125. char effort[30]; // breezing or handily
  126. char rank[20];
  127. raceTime workoutTime;
  128. } workoutLine;
  129.  
  130.  
  131.  
  132. // used as types for members of the two main structures below
  133.  
  134.  
  135. // add a structure to store details on each race
  136.  
  137. typedef struct
  138. {
  139. date raceDate; // A - the date of the race
  140. raceTime race_time; // A - the time of the race
  141. int raceNumber; // C - the specific race number identifier
  142. char trackName[50]; // E - the name of the track where the race was held
  143. int raceRating; // G - estimate of what the winner will earn
  144. char raceType[20]; // I - what type of race the event is about
  145. condition raceCondition; // J - conditions of the race
  146. record trackRecordHolder; // K - track record holder info
  147. } race_details;
  148.  
  149.  
  150.  
  151.  
  152. // add a structure to store details on each horse
  153.  
  154. struct horse_details_and_past_performance
  155. {
  156.  
  157. int programNumber; // 1 - the program number
  158. char saddleColor[20]; // 2 - color cloth the horse has under saddle
  159. char mlOdds[8]; // 3 - morning line odds
  160. int claimingPrice; // 4 - horse sale price if claimed by new owner
  161. OT_info horseOT; // 5-7 - owner and trainer info
  162. char horseName[50]; // 8 - horse name
  163. ME_info horseME[3]; // 9/34 - horse medication and equipment
  164. bio_info horseStats; // biological information of horse (10-11)
  165. jockey horseJockey; // 12
  166. int horseClass; // 13 - horse class figure
  167. totals horseTotals; // 14 - 15
  168. trackCondition trackConditions; // 18
  169. raceCondition raceConditions; // 20-26
  170. positions horsePositions; // 29-31
  171. float finalOdds; // 35 - win odds for the horse at the start time of the race
  172. topThreeFinishers raceFinishers; // 36
  173. char footNotes[100]; // 37
  174. int numHorses; // 38
  175. char claimingInfo[50]; // 39 - shows new owner, previous owner, claiming price
  176. workoutLine horseWorkout; // 40
  177.  
  178.  
  179. };
  180.  
  181. int main ( )
  182. {
  183.  
  184. race_details myRaces[10];
  185. horse_details_and_past_performance myHorses[20];
  186.  
  187. return (0);
  188. };
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty