Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. class Team
  2. {
  3. private:
  4. string Name = "";
  5. string Coach_Name = "";
  6. string Home_City = "";
  7. bool Home_Status = false;
  8. int Score = 0;
  9. int Timeout_Count = 0;
  10. public:
  11. void setName(string n)
  12. {
  13. Name = n;
  14. }
  15. string getName()
  16. {
  17. return Name;
  18. }
  19. void setCoach_Name(string cn)
  20. {
  21. Coach_Name = cn;
  22. }
  23. string getCoach_Name()
  24. {
  25. return Coach_Name;
  26. }
  27. void setHome_City(string hc)
  28. {
  29. Home_City = hc;
  30. }
  31. string getHome_City()
  32. {
  33. return Home_City;
  34. }
  35. void setHome_Status(bool hs)
  36. {
  37. Home_Status = hs;
  38. }
  39. bool getHome_Status()
  40. {
  41. return Home_Status;
  42. }
  43. void setScore(int s)
  44. {
  45. Score = s;
  46. }
  47. int getScore()
  48. {
  49. return Score;
  50. }
  51. void setTimeout_Count(int tc)
  52. {
  53. Timeout_Count = tc;
  54. }
  55. int getTimeout_Count()
  56. {
  57. return Timeout_Count;
  58. }
  59. };
  60.  
  61. class Scoreboard
  62. {
  63. private:
  64. double clock = 00.00;
  65. bool Possession_Status = false;
  66. double Yards_ToGo = 0.0;
  67. int Quarter = 0;
  68.  
  69. public:
  70. Team T1;
  71. Team T2;
  72. void setClock(double c)
  73. {
  74. clock = c;
  75. }
  76. double getClock()
  77. {
  78. return clock;
  79. }
  80. void setPossession_Status(bool ps)
  81. {
  82. Possession_Status = ps;
  83. }
  84. bool getPossession_Status()
  85. {
  86. return Possession_Status;
  87. }
  88. void setYards_ToGo(double ytg)
  89. {
  90. Yards_ToGo = ytg;
  91. }
  92. double getYards_ToGo()
  93. {
  94. return Yards_ToGo;
  95. }
  96. void setQuarter(int q)
  97. {
  98. Quarter = q;
  99. }
  100. int getQuarter()
  101. {
  102. return Quarter;
  103. }
  104. void updateName(Scoreboard&)
  105. {
  106. string temp;
  107. cout << "Enter the team name: \n";
  108. temp = validateString(temp);
  109. T1.setName(temp);
  110. return;
  111. }
  112. void updateCoach_Name(Scoreboard&)
  113. {
  114. string temp;
  115. cout << "Enter the coach name: \n";
  116. temp = validateString(temp);
  117. T1.setCoach_Name(temp);
  118. return;
  119. }
  120. void updateHome_City(Scoreboard&)
  121. {
  122. string temp;
  123. cout << "Enter the home city: \n";
  124. temp = validateString(temp);
  125. T1.setHome_City(temp);
  126. return;
  127. }
  128. void updateHome_Status(Scoreboard&)
  129. {
  130. char temp;
  131. cout << "Is " << T1.getName() << " the home team?\n";
  132. cout << "Enter either Y (yes) or N (no)...\n";
  133. temp = validateChar(temp);
  134. if ( temp = 'Y' ){ T1.setHome_Status(true); }
  135. else if ( temp = 'N' ){ T1.setHome_Status(false); }
  136. return;
  137. }
  138. void updateScore(Scoreboard&)
  139. {
  140. int temp;
  141. cout << "Enter the current score: \n";
  142. temp = validateInt(temp);
  143. T1.setScore(temp);
  144. return;
  145. }
  146. void updateTimeout_Count(Scoreboard&)
  147. {
  148. int temp;
  149. cout << "Enter the team name: \n";
  150. temp = validateInt(temp);
  151. T1.setTimeout_Count(temp);
  152. return;
  153. }
  154. void updatePoss_Status(Scoreboard&)
  155. {
  156. char temp;
  157. cout << "Does " << T2.getName() << " have possession of the ball?\n";
  158. cout << "Enter either Y (yes) or N (no)...\n";
  159. temp = validateChar(temp);
  160. if ( temp = 'Y' ){ setPossession_Status(true); }
  161. else if ( temp = 'N' ){ setPossession_Status(false); }
  162. return;
  163. }
  164. void updateYTG(Scoreboard&)
  165. {
  166. int temp;
  167. cout << "Enter the current yards to go: \n";
  168. temp = validateInt(temp);
  169. setYards_ToGo(temp);
  170. return;
  171. }
  172. void updateQuarter(Scoreboard&)
  173. {
  174. int temp;
  175. cout << "Enter the current quarter: \n";
  176. temp = validateInt(temp);
  177. setQuarter(temp);
  178. return;
  179. }
  180. void updateName2(Scoreboard&)
  181. {
  182. string temp;
  183. cout << "Enter the team name: \n";
  184. temp = validateString(temp);
  185. T2.setName(temp);
  186. return;
  187. }
  188. void updateCoach_Name2(Scoreboard&)
  189. {
  190. string temp;
  191. cout << "Enter the coach name: \n";
  192. temp = validateString(temp);
  193. T2.setCoach_Name(temp);
  194. return;
  195. }
  196. void updateHome_City2(Scoreboard&)
  197. {
  198. string temp;
  199. cout << "Enter the home city: \n";
  200. temp = validateString(temp);
  201. T2.setHome_City(temp);
  202. return;
  203. }
  204. void updateHome_Status2(Scoreboard&)
  205. {
  206. char temp;
  207. cout << "Is " << T1.getName() << " the home team?\n";
  208. cout << "Enter either Y (yes) or N (no)...\n";
  209. temp = validateChar(temp);
  210. if ( temp = 'Y' ){ T2.setHome_Status(true); }
  211. else if ( temp = 'N' ){ T2.setHome_Status(false); }
  212. return;
  213. }
  214. void updateScore2(Scoreboard&)
  215. {
  216. int temp;
  217. cout << "Enter the current score: \n";
  218. temp = validateInt(temp);
  219. T2.setScore(temp);
  220. return;
  221. }
  222. void updateTimeout_Count2(Scoreboard&)
  223. {
  224. int temp;
  225. cout << "Enter the team name: \n";
  226. temp = validateInt(temp);
  227. T2.setTimeout_Count(temp);
  228. return;
  229. }
  230. void updatePoss_Status2(Scoreboard&)
  231. {
  232. char temp;
  233. cout << "Does " << T2.getName() << " have possession of the ball?\n";
  234. cout << "Enter either Y (yes) or N (no)...\n";
  235. temp = validateChar(temp);
  236. if ( temp = 'Y' ){ setPossession_Status(true); }
  237. else if ( temp = 'N' ){ setPossession_Status(false); }
  238. return;
  239. }
  240. void updateYTG2(Scoreboard&)
  241. {
  242. int temp;
  243. cout << "Enter the current yards to go: \n";
  244. temp = validateInt(temp);
  245. setYards_ToGo(temp);
  246. return;
  247. }
  248. void updateQuarter2(Scoreboard&)
  249. {
  250. int temp;
  251. cout << "Enter the current quarter: \n";
  252. temp = validateInt(temp);
  253. setQuarter(temp);
  254. return;
  255. }
  256. };
  257.  
  258. void displayScoreboard(Scoreboard& s1);
  259. void menuTeam1(Scoreboard& s1);
  260. void menuTeam2(Scoreboard& s1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement