fork download
  1.  
  2. struct date
  3. {
  4. int year;
  5. int month;
  6. int day;
  7. };
  8.  
  9. // TODO - add other supporting structures that could be -
  10. // used as types for members of the two main structures below
  11. struct time
  12. {
  13. int hour;
  14. int minute;
  15. };
  16.  
  17. struct trainer_t
  18. {
  19. char name[50];
  20. int starts;
  21. int wins;
  22. int places;
  23. int shows;
  24. };
  25.  
  26. struct fraction
  27. {
  28. int nominator;
  29. int denominator;
  30. };
  31.  
  32. struct topFinisher
  33. {
  34. char horseName[50];
  35. float weightCarried;
  36. float margin;
  37. };
  38.  
  39. struct claimingInformation_t
  40. {
  41. char newOwner[50];
  42. char previousOwner[50];
  43. };
  44.  
  45. struct workoutLines_t
  46. {
  47. struct date dateOfWorkout;
  48. char trackName[50];
  49. float trackDistance;
  50. char trackCondition[50];
  51. struct time lengthOfWorkout;
  52. char breezingOrHandly[50];
  53. struct fraction rank;
  54. };
  55.  
  56. struct raceCondition_t
  57. {
  58. float purse;
  59. char descriptionOfRace[50];
  60. char ageRestriction[50];
  61. float weightAssignments;
  62. char claimingCondition[50];
  63. float raceDistance;
  64. };
  65.  
  66. struct trackRecordHolder_t
  67. {
  68. char name[50];
  69. int age;
  70. float weightCarried;
  71. struct time raceTime;
  72. int starts;
  73. int wins;
  74. int places;
  75. int shows;
  76. };
  77.  
  78. struct totalsAtTrack_t
  79. {
  80. char atThisTrack[50];
  81. int starts;
  82. int wins;
  83. int place;
  84. int show;
  85. int speedFigure;
  86. int earnings;
  87. };
  88.  
  89. struct totalsAtDistance_t
  90. {
  91. char distanceSurfaceRecord[50];
  92. int starts;
  93. int wins;
  94. int place;
  95. int show;
  96. int speedFigure;
  97. int earnings;
  98. };
  99.  
  100. // add a structure to store details on each race
  101. // define symbolic constants for string length - not 50 or 200 etc
  102.  
  103.  
  104. struct race_details
  105. {
  106. struct date raceDate; // A - the date of the race
  107. struct time raceTime; //A - time of race
  108. char wagersAvailable[50]; //B
  109. int raceNumber; // C - the specific race number identifier
  110. char trackName[50]; // E - the name of the track where the race was held
  111. unsigned char trackDiagram[10000]; //D
  112. unsigned char QRCode [5000]; //F
  113. int raceRating; //G
  114. unsigned char notes[100]; //H
  115. char raceType[50]; //I, 26
  116. struct raceCondition_t raceCondition; //J
  117. struct trackRecordHolder_t trackRecordHolder; //K
  118. unsigned char videoCameraIcon; //16
  119. char raceDateLink[50]; //16
  120. char trackCode[50]; //17
  121. char trackCondition[50]; //18
  122. unsigned char trackSurface; //19
  123. char raceDistance[50]; //20 //prob should be enum
  124. float fractionalTimes; //22
  125. int ageResctriction; //23
  126. struct topFinisher topThreeFinishers [3]; //36
  127. char footnotes[100]; //37
  128. int numberOfHorses; //38
  129. struct claimingInformation_t claimingInformation; //39
  130. };
  131.  
  132. // add a structure to store details on each horse
  133.  
  134. struct horse_details_and_past_performance
  135. {
  136.  
  137. int programNumber; // 1 - the program number
  138. char horseName[50]; // 8 - horse name
  139. char horseGender; // 10 - gender of the horse
  140. char saddleClothColor[50]; //2
  141. struct fraction morningOddLines; //3
  142. float claimingPrice; //4
  143. char owner[50]; //5
  144. char silks[50]; //6
  145. struct trainer_t trainer; //7
  146. char medication; //9, 34
  147. char equipment; //9, 34
  148. char horseColor[5]; //10
  149. int age; //10
  150. char sire[50]; //10
  151. char dam[50]; //10
  152. float weightCarried; //11, 33
  153. struct trainer_t jockey; //12, 32
  154. int horseClassFigure; //13
  155. struct totalsAtTrack_t totalsAtTrack; //14
  156. struct totalsAtDistance_t totalsAtDistance; //15
  157. int daysUnraced; //21
  158. char restrictedToFillies; //24
  159. char restrictedToStateBredHorses; //25
  160. int equibasePaceFigures; //27
  161. int speedFigure; //28
  162. int postPosition; //29
  163. float calls; //30
  164. float finalPosition; //31
  165. float finalOdds; //35
  166. struct workoutLines_t workoutLines; //40
  167. };
  168.  
  169.  
  170. int main ( )
  171. {
  172.  
  173. // NOTE: You don't have to populate any of these!!!
  174.  
  175. struct race_details myRaces[10];
  176. struct horse_details_and_past_performance myHorses[20];
  177.  
  178. // nothing else needs to be added to main
  179. return (0);
  180. };
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty