Advertisement
Guest User

Untitled

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