fork download
  1. #include <stdio.h>
  2. struct date
  3. {
  4. int month;
  5. int day;
  6. int year;
  7. };
  8.  
  9. struct time
  10. {
  11. int hour;
  12. int minute;
  13. };
  14.  
  15. struct performanceTotals
  16. {
  17. int starts;
  18. int wins;
  19. int places;
  20. int shows;
  21. };
  22.  
  23. struct owner
  24. {
  25. char name[100];
  26. char address[200];
  27. struct performanceTotals records;
  28. };
  29.  
  30. struct trainer
  31. {
  32. char name[100];
  33. struct performanceTotals records;
  34. };
  35.  
  36. struct jockey
  37. {
  38. char name[100];
  39. float weight; //assuming this would be an important thing
  40. struct performanceTotals records;
  41. };
  42.  
  43. struct trackRecord
  44. {
  45. char holderName[50];
  46. struct date recordDate;
  47. struct time recordTime;
  48. };
  49.  
  50. struct raceConditions
  51. {
  52. char raceType[50];
  53. char trackSurface[20];
  54. char trackCondition[20];
  55. float raceDistance;
  56. };
  57.  
  58. // Main structures
  59. struct raceDetails
  60. {
  61. struct date raceDate; // date of the race
  62. struct time raceTime; // time of the race
  63. int raceNumber; // race number
  64. char trackName[50]; // track name
  65. char trackCode[10]; // track code
  66. struct raceConditions conditions; // race conditions
  67. float purse; // purse amount
  68. struct trackRecord record; // track record details
  69. char raceType[50]; // type of race
  70. char wagersAvailable[100]; // available wagers
  71. char qrCode[100]; // QR code for race (zero clue how you would store this, maybe the data contained in the code? i dont know, but its here)
  72. char notes[200]; // space for notes
  73. };
  74.  
  75. struct horse
  76. {
  77. int programNumber; // program number
  78. char horseName[50]; // horse name
  79. char horseGender; // horse gender
  80. int age; // horse age
  81. char color[20]; // horse color
  82. char sire[50]; // horse sire
  83. char dam[50]; // horse dam
  84. struct owner ownerDetails; // owner details
  85. struct trainer trainerDetails; // trainer details
  86. struct jockey jockeyDetails; // jockey details
  87. float weightCarried; // weight carried
  88. char medicationAndEquipment[100]; // medication and equipment details
  89. float morningLineOdds; // morning line odds
  90. float claimingPrice; // claiming price
  91. char silks[100]; // silk description
  92. char saddleClothColor[20]; // saddle cloth color
  93. int speedFigure;
  94. struct performanceTotals lifetime; // lifetime performance
  95. struct performanceTotals currentYear; // current year performance
  96. struct performanceTotals previousYear; // previous year performance
  97. struct performanceTotals trackSpecific; // performance at this track
  98. struct performanceTotals distanceSpecific; // performance at this distance
  99. float earnings; // how much the horse earned (do they get paid?)
  100. char recentWorkoutLines[200]; // recent workout lines
  101. int daysUnraced; // days since last race
  102. };
  103.  
  104. int main() {
  105. // Arrays to hold race and horse details
  106. struct raceDetails myRaces[10];
  107. struct horse myHorses[20];
  108.  
  109. // Nothing else needs to be added to main
  110. return 0;
  111. }
  112.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty