Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Team
- {
- private:
- string Name = "";
- string Coach_Name = "";
- string Home_City = "";
- bool Home_Status = false;
- int Score = 0;
- int Timeout_Count = 0;
- public:
- void setName(string n)
- {
- Name = n;
- }
- string getName()
- {
- return Name;
- }
- void setCoach_Name(string cn)
- {
- Coach_Name = cn;
- }
- string getCoach_Name()
- {
- return Coach_Name;
- }
- void setHome_City(string hc)
- {
- Home_City = hc;
- }
- string getHome_City()
- {
- return Home_City;
- }
- void setHome_Status(bool hs)
- {
- Home_Status = hs;
- }
- bool getHome_Status()
- {
- return Home_Status;
- }
- void setScore(int s)
- {
- Score = s;
- }
- int getScore()
- {
- return Score;
- }
- void setTimeout_Count(int tc)
- {
- Timeout_Count = tc;
- }
- int getTimeout_Count()
- {
- return Timeout_Count;
- }
- };
- class Scoreboard
- {
- private:
- double clock = 00.00;
- bool Possession_Status = false;
- double Yards_ToGo = 0.0;
- int Quarter = 0;
- public:
- Team T1;
- Team T2;
- void setClock(double c)
- {
- clock = c;
- }
- double getClock()
- {
- return clock;
- }
- void setPossession_Status(bool ps)
- {
- Possession_Status = ps;
- }
- bool getPossession_Status()
- {
- return Possession_Status;
- }
- void setYards_ToGo(double ytg)
- {
- Yards_ToGo = ytg;
- }
- double getYards_ToGo()
- {
- return Yards_ToGo;
- }
- void setQuarter(int q)
- {
- Quarter = q;
- }
- int getQuarter()
- {
- return Quarter;
- }
- void updateName(Scoreboard&)
- {
- string temp;
- cout << "Enter the team name: \n";
- temp = validateString(temp);
- T1.setName(temp);
- return;
- }
- void updateCoach_Name(Scoreboard&)
- {
- string temp;
- cout << "Enter the coach name: \n";
- temp = validateString(temp);
- T1.setCoach_Name(temp);
- return;
- }
- void updateHome_City(Scoreboard&)
- {
- string temp;
- cout << "Enter the home city: \n";
- temp = validateString(temp);
- T1.setHome_City(temp);
- return;
- }
- void updateHome_Status(Scoreboard&)
- {
- char temp;
- cout << "Is " << T1.getName() << " the home team?\n";
- cout << "Enter either Y (yes) or N (no)...\n";
- temp = validateChar(temp);
- if ( temp = 'Y' ){ T1.setHome_Status(true); }
- else if ( temp = 'N' ){ T1.setHome_Status(false); }
- return;
- }
- void updateScore(Scoreboard&)
- {
- int temp;
- cout << "Enter the current score: \n";
- temp = validateInt(temp);
- T1.setScore(temp);
- return;
- }
- void updateTimeout_Count(Scoreboard&)
- {
- int temp;
- cout << "Enter the team name: \n";
- temp = validateInt(temp);
- T1.setTimeout_Count(temp);
- return;
- }
- void updatePoss_Status(Scoreboard&)
- {
- char temp;
- cout << "Does " << T2.getName() << " have possession of the ball?\n";
- cout << "Enter either Y (yes) or N (no)...\n";
- temp = validateChar(temp);
- if ( temp = 'Y' ){ setPossession_Status(true); }
- else if ( temp = 'N' ){ setPossession_Status(false); }
- return;
- }
- void updateYTG(Scoreboard&)
- {
- int temp;
- cout << "Enter the current yards to go: \n";
- temp = validateInt(temp);
- setYards_ToGo(temp);
- return;
- }
- void updateQuarter(Scoreboard&)
- {
- int temp;
- cout << "Enter the current quarter: \n";
- temp = validateInt(temp);
- setQuarter(temp);
- return;
- }
- void updateName2(Scoreboard&)
- {
- string temp;
- cout << "Enter the team name: \n";
- temp = validateString(temp);
- T2.setName(temp);
- return;
- }
- void updateCoach_Name2(Scoreboard&)
- {
- string temp;
- cout << "Enter the coach name: \n";
- temp = validateString(temp);
- T2.setCoach_Name(temp);
- return;
- }
- void updateHome_City2(Scoreboard&)
- {
- string temp;
- cout << "Enter the home city: \n";
- temp = validateString(temp);
- T2.setHome_City(temp);
- return;
- }
- void updateHome_Status2(Scoreboard&)
- {
- char temp;
- cout << "Is " << T1.getName() << " the home team?\n";
- cout << "Enter either Y (yes) or N (no)...\n";
- temp = validateChar(temp);
- if ( temp = 'Y' ){ T2.setHome_Status(true); }
- else if ( temp = 'N' ){ T2.setHome_Status(false); }
- return;
- }
- void updateScore2(Scoreboard&)
- {
- int temp;
- cout << "Enter the current score: \n";
- temp = validateInt(temp);
- T2.setScore(temp);
- return;
- }
- void updateTimeout_Count2(Scoreboard&)
- {
- int temp;
- cout << "Enter the team name: \n";
- temp = validateInt(temp);
- T2.setTimeout_Count(temp);
- return;
- }
- void updatePoss_Status2(Scoreboard&)
- {
- char temp;
- cout << "Does " << T2.getName() << " have possession of the ball?\n";
- cout << "Enter either Y (yes) or N (no)...\n";
- temp = validateChar(temp);
- if ( temp = 'Y' ){ setPossession_Status(true); }
- else if ( temp = 'N' ){ setPossession_Status(false); }
- return;
- }
- void updateYTG2(Scoreboard&)
- {
- int temp;
- cout << "Enter the current yards to go: \n";
- temp = validateInt(temp);
- setYards_ToGo(temp);
- return;
- }
- void updateQuarter2(Scoreboard&)
- {
- int temp;
- cout << "Enter the current quarter: \n";
- temp = validateInt(temp);
- setQuarter(temp);
- return;
- }
- };
- void displayScoreboard(Scoreboard& s1);
- void menuTeam1(Scoreboard& s1);
- void menuTeam2(Scoreboard& s1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement