Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct Players {
  6.     string name;
  7.     string surname;
  8.     string position;
  9.     int age;
  10.     int number;
  11.  
  12. };
  13. struct Team {
  14.     string name;
  15.     int pos;
  16. };
  17. struct League {
  18.     string name;
  19.     int division;
  20.     Team teams[24];
  21.     int noClubs=0;
  22.     void print()
  23.     {
  24.         cout << "Division: " << division << endl;
  25.         cout << "League Name: " << name << endl;
  26.  
  27.     }
  28.     void clubLeague(Team t)
  29.     {
  30.         teams[24] = t;
  31.         noClubs++;
  32.     }
  33. };
  34. struct Countries {
  35.     string name;
  36.     League leagues[2];
  37.     int noLeagues = 0;
  38.     Countries(string n) {
  39.         name = n;
  40.     }
  41.     void leaguestate(League l)
  42.     {
  43.         leagues[noLeagues] = l;
  44.         noLeagues++;
  45.     }
  46.     void print()
  47.     {
  48.         cout << "Country: " << name << endl;
  49.  
  50.         for (int i = 0; i < noLeagues; i++)
  51.             leagues[i].print();
  52.         cout << "-------------------" << endl;
  53.     }
  54.  
  55. };
  56. /*struct Players {
  57.     string name;
  58.     string surname;
  59.     string position;
  60.     int age;
  61.     int number;
  62.  
  63. };*/
  64.  
  65. int main() {
  66.     Countries england("England");
  67.     Countries spain("Spain");
  68.     Countries macedonia("Macedonia");
  69.  
  70.     League epl1{ "English Premier League",1 };
  71.     League epl2{ "English Championship",2 };
  72.     League laliga{ "La Liga Santander",1 };
  73.     League secunda{ "Secunda Division",2 };
  74.     League league1{ "First League",1 };
  75.     League league2{ "Second League",2 };
  76.  
  77.    
  78.     Team liverpool{ "Liverpool", 1 };
  79.     Team mancity{ "Manchester City", 2 };
  80.     Team tottenham{ "Tottenham",3 };
  81.     Team arsenal{ "Arsenal", 4};
  82.     Team manunited{ "Manchester United", 5 };
  83.     Team chelsea{ "Chelsea",6 };
  84.     Team wolves{ "Wolves", 7 };
  85.     Team watford{ "Watford", 8 };
  86.     Team westham{ "West Ham",9 };
  87.     Team leicester{ "Leicster City", 10 };
  88.     Team everton{ "Everton",11 };
  89.     Team bournemouth{ "Bournemouth", 12 };
  90.     Team newcastle{ "Newcastle", 13 };
  91.     Team crystalpalace{ "Crystal Palace", 14 };
  92.     Team brighton{ "Brighton",15 };
  93.     Team southhampton{ "Southhampton", 16 };
  94.     Team burnley{ "Burnley",17 };
  95.     Team cardiff{ "Cardiff", 18 };
  96.     Team fulham{ "Fulham", 19 };
  97.     Team huddersfield{ "Huddersfield", 20 };
  98.  
  99.     epl1.clubLeague(liverpool);
  100.     //futja e ligave ne shtete
  101.     england.leaguestate(epl1);
  102.     england.leaguestate(epl2);
  103.     spain.leaguestate(laliga);
  104.     spain.leaguestate(secunda);
  105.     macedonia.leaguestate(league1);
  106.     macedonia.leaguestate(league2);
  107.  
  108.     epl1.clubLeague(chelsea);
  109.  
  110.     string n;
  111.     cout << "Football leagues" << endl;
  112.     cout << "Choose country to see the leagues: " << endl;
  113.     cout << "1.England " << endl;
  114.     cout << "2.Spain " << endl;
  115.     cout << "3.Macedonia" << endl;
  116.     cin >> n;
  117.     if ((n == "England") || (n == "england"))
  118.     {
  119.         england.print();
  120.     }
  121.     else
  122.         if ((n == "Spain") || (n == "spain"))
  123.         {
  124.             spain.print();
  125.         }
  126.         else
  127.             if ((n == "Macedonia") || (n == "macedonia"))
  128.             {
  129.                 macedonia.print();
  130.             }
  131.             else
  132.             {
  133.                 cout << "You choose wrong name";
  134.             }
  135.  
  136.     cin.get(); cin.get();
  137.     return 0;
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement