fork download
  1. // Assignment Question 8 Final Exam
  2. //
  3. // Name: <Tasos Paloukos>
  4. //
  5. // Class: C Programming, <Fall 2024>
  6. //
  7. // Date: <December 11, 2024>
  8.  
  9. #include <stdio.h>
  10.  
  11. // Define the date structure
  12. struct date {
  13. int month;
  14. int day;
  15. int year;
  16. };
  17.  
  18. // Define additional supporting structures
  19. struct time {
  20. int hour;
  21. int minute;
  22. int second;
  23. };
  24.  
  25. struct jockey {
  26. char name[50];
  27. int experience; // in years
  28. };
  29.  
  30. struct trainer {
  31. char name[50];
  32. int experience; // in years
  33. };
  34.  
  35. // Define the race details structure
  36. struct race_details {
  37. struct date raceDate; // the date of the race
  38. struct time raceTime; // the time of the race
  39. int raceNumber; // the specific race number identifier
  40. char trackName[50]; // the name of the track where the race was held
  41. int distance; // distance of the race in meters
  42. char raceType[30]; // type of race (e.g., flat, steeplechase)
  43. struct jockey raceJockey; // jockey details
  44. };
  45.  
  46. // Define the horse details and past performance structure
  47. struct horse_details_and_past_performance {
  48. int programNumber; // the program number
  49. char horseName[50]; // horse name
  50. char horseGender; // gender of the horse
  51. int age; // age of the horse
  52. char breed[30]; // breed of the horse
  53. struct trainer horseTrainer; // trainer details
  54. int wins; // number of wins
  55. int losses; // number of losses
  56. int earnings; // total earnings in dollars
  57. };
  58.  
  59. int main() {
  60. // NOTE: You don't have to populate any of these!!!
  61.  
  62. struct race_details myRaces[10];
  63. struct horse_details_and_past_performance myHorses[20];
  64.  
  65. // nothing else needs to be added to main
  66. return 0;
  67. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty