Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.69 KB | None | 0 0
  1. #ifndef STRUCTS_H_INCLUDED
  2. #define STRUCTS_H_INCLUDED
  3.  
  4. #include <iostream>
  5. #include <string>
  6. #include <fstream>
  7.  
  8. /**
  9. This structure is to store the date and it has three integer fields
  10. **/
  11. struct Date{
  12.     int day;
  13.     int month;
  14.     int year;
  15.     Date();
  16. };
  17.  
  18. Date::Date()
  19. {
  20.     day = 0;
  21.     month = 0;
  22.     year = 0000;
  23. }
  24.  
  25. /**
  26. This structure is to store the size of the enclosure and it has three int fields
  27. **/
  28.  
  29. struct SizeOfEnclosure{
  30.     int length;
  31.     int width;
  32.     int height;
  33.     SizeOfEnclosure();
  34. };
  35.  
  36. SizeOfEnclosure::SizeOfEnclosure()
  37. {
  38.     length = 0;
  39.     width = 0;
  40.     height = 0;
  41. }
  42.  
  43. /**
  44. This structure is to store the danger assessment. It contains a Char: 'V' or 'N' for venomous or non venomous.
  45. It also contains an int from 0-10 for the aggressiveness rating.
  46. **/
  47. struct DangerAssessment{
  48.     char venoumous;
  49.     int agression;
  50.     DangerAssessment();
  51. };
  52.  
  53. DangerAssessment::DangerAssessment()
  54. {
  55.     venoumous = ' ';
  56.     agression = 0;
  57. }
  58.  
  59. /**
  60. This is the main mammal structure
  61. **/
  62.  
  63. struct Mammal {
  64.     std::string species;
  65.     Date birthDate;
  66.     int weight;
  67.     SizeOfEnclosure sizeofenclosure;
  68.     std::string exhibitName;
  69.     Mammal();
  70.  
  71.     void getMammalsData(std::ifstream& inFile);
  72.     void displayMammals(Mammal mammals[], int totalMammals);
  73.     void printExhibitForMammals(std::string exhibitNameToCompare);
  74. };
  75.  
  76. Mammal::Mammal()
  77. {
  78.     species = " ";
  79.     weight =  0;
  80.     exhibitName = " ";
  81. }
  82.  
  83. /**
  84. This is the main bird structure
  85. **/
  86.  
  87. struct Bird {
  88.     std::string species;
  89.     Date birthDate;
  90.     int weight;
  91.     char canFly;
  92.     std::string exhibitName;
  93.     Bird();
  94.  
  95.     void getBirdsData(std::ifstream& inFile);
  96.     void displayBirds(Bird birds[], int totalBirds);
  97. };
  98.  
  99. Bird::Bird()
  100. {
  101.     species = " ";
  102.     weight = 0;
  103.     canFly = ' ';
  104.     exhibitName = " ";
  105. }
  106.  
  107. /**
  108. This is the main reptile structure
  109. **/
  110.  
  111. struct Reptile {
  112.     std::string species;
  113.     DangerAssessment dangerAssess;
  114.     Date birthDate;
  115.     SizeOfEnclosure sizeofenclosure;
  116.     std::string exhibitName;
  117.     Reptile();
  118.  
  119.     void getReptilesData(std::ifstream& inFile);
  120.     void displayReptiles(Reptile reptiles[],int totalReptiles);
  121. };
  122.  
  123. Reptile::Reptile()
  124. {
  125.     species = " ";
  126.     exhibitName = " ";
  127. }
  128. /**
  129. This is the main personnel structure
  130. **/
  131.  
  132. struct Personnel {
  133.     std::string name;
  134.     Date hireDate;
  135.     std::string jobTitle;
  136.     std::string exhibitName;
  137.     Personnel();
  138.  
  139.     void getPersonnelData(std::ifstream& inFile);
  140.     void displayPersonnel(Personnel personnel[], int totalPersonnel);
  141. };
  142.  
  143. Personnel::Personnel()
  144. {
  145.     name = " ";
  146.     jobTitle = " ";
  147.     exhibitName = " ";
  148. }
  149.  
  150. #endif // STRUCTS_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement