Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <iomanip>
- using namespace std;
- struct Players {
- string name;
- string surname;
- string position;
- int age;
- int number;
- int noPlayers = 0;
- void print() {
- cout << "Player: " << name << surname << endl;
- cout << "Position: " << position << endl;
- cout << "Age: " << age << endl;
- cout << "Number: " << number << endl;
- cout << "---------------------------" << endl;
- }
- };
- struct Team {
- string name;
- int pos;
- int noClubs = 0;
- Players players[3];
- void printTeam()
- {
- cout << "\n" << left << setw(35) << name;
- cout << setw(35) << pos;
- }
- int noPlayers = 0;
- void playerClub(Players p)
- {
- players[noPlayers] = p;
- noPlayers++;
- }
- void printPlayers()
- {
- for (int i = 0;i < noPlayers; i++)
- {
- players[i].print();
- }
- }
- };
- struct League {
- string name;
- int division;
- Team teams[24];
- int noClubs=0;
- void print()
- {
- cout << "Division: " << division << endl;
- cout << "League Name: " << name << endl;
- }
- void clubLeague(Team t)
- {
- teams[noClubs] = t;
- noClubs++;
- }
- void printT()
- {
- cout << "League: " << name << endl;
- cout << "Team "<< setw(35) << "Position" << setw(35);
- for (int i = 0; i <= noClubs-1; i++)
- {
- teams[i].printTeam();
- }
- }
- };
- struct Countries {
- string name;
- League leagues[2];
- int noLeagues = 0;
- Countries(string n) {
- name = n;
- }
- void leaguestate(League l)
- {
- leagues[noLeagues] = l;
- noLeagues++;
- }
- void print()
- {
- cout << "Country: " << name << endl;
- for (int i = 0; i < noLeagues; i++)
- leagues[i].print();
- }
- };
- int main() {
- int division;
- int club;
- Countries england("England");
- Countries spain("Spain");
- Countries macedonia("Macedonia");
- League epl1{ "English Premier League",1 };
- League epl2{ "English Championship",2 };
- League laliga{ "La Liga Santander",1 };
- League secunda{ "Secunda Division",2 };
- League league1{ "First League",1 };
- League league2{ "Second League",2 };
- //Epl1 Teams
- Team liverpool{ "Liverpool", 1 };
- Team mancity{ "Manchester City", 2 };
- Team tottenham{ "Tottenham",3 };
- Team arsenal{ "Arsenal", 4 };
- Team manunited{ "Manchester United", 5 };
- //Putting clubs into league for EPL
- epl1.clubLeague(liverpool);
- epl1.clubLeague(mancity);
- epl1.clubLeague(tottenham);
- epl1.clubLeague(arsenal);
- epl1.clubLeague(manunited);
- //Liverpool Players
- Players dejan{ "Dejan", " Lovren", "Centerback", 29, 6 };
- Players joel{ "Joel", " Matip", "Centerback", 27, 32 };
- Players shaqiri{ "Xherdan", " Shaqiri", "Attacking Midfielder", 28, 23 };
- liverpool.playerClub(dejan);
- liverpool.playerClub(joel);
- liverpool.playerClub(shaqiri);
- //Manchester City players
- Players otamendi{ "Nicholas", " Otamendi", "Centerback", 31, 30 };
- Players kevin{ "Kevin", " De Bryune", "Center Midfielder", 27, 17 };
- Players jesus{ "Gabriel", " Jesus", "Forward", 21, 33 };
- mancity.playerClub(otamendi);
- mancity.playerClub(kevin);
- mancity.playerClub(jesus);
- //Tottenham players
- Players ericssen{ "Christian", " Ericssen", "Midfielder", 23, 27 };
- Players dele{ "Dele", " Alli", "Attacking Midfielder", 22, 20 };
- Players kane{ "Harry", " Kane", "Center Forward", 25, 10 };
- tottenham.playerClub(ericssen);
- tottenham.playerClub(dele);
- tottenham.playerClub(kane);
- //Arsenal players
- Players bellerin{ "Hector", " Bellerin", "Left Back", 24, 2 };
- Players mustafi{ "Shkodran", " Mustafi", "Center Back", 26, 20 };
- Players ozil{ "Mesut", " Ozil", "Attacking Midfielder", 30, 10 };
- arsenal.playerClub(bellerin);
- arsenal.playerClub(mustafi);
- arsenal.playerClub(ozil);
- //Man United players
- Players david{ "David", " de Gea", "Goalkeeper", 27, 1 };
- Players jesse{ "Jesse", " Lingard", "Left Wing", 26, 14 };
- Players lukaku{ "Romelo", " Lukaku", "Striker", 25, 9 };
- manunited.playerClub(david);
- manunited.playerClub(jesse);
- manunited.playerClub(lukaku);
- //Putting clubs into league for EPL2
- Team norwich{ "Norwich City", 1 };
- Team sheffutd{ "Sheff Utd", 2 };
- Team leeds{ "Leeds United", 3 };
- Team westbrom{ "West Brom", 4 };
- Team middlesbrough{ "Middlesbrough", 5 };
- epl2.clubLeague(norwich);
- epl2.clubLeague(sheffutd);
- epl2.clubLeague(leeds);
- epl2.clubLeague(westbrom);
- epl2.clubLeague(middlesbrough);
- //Putting players in clubs for EPL2
- //Norwich players
- Players alfie{ "Alfie", " Payne", "Midfielder", 18, 16 };
- Players teemu{ "Teemu", " Pukki", "Forward", 24, 8 };
- Players ben{ "Ben", " Godfrey", "Attacker", 21, 22 };
- norwich.playerClub(alfie);
- norwich.playerClub(teemu);
- norwich.playerClub(ben);
- //Sheffield players
- Players dean{ "Dean", " Henderson", "Goalkeeper", 22, 38 };
- Players jack{ "Jack", "O'Connell", "Defender", 24, 35 };
- Players billy{ "Billy", " Sharp", "Attacker", 33, 34 };
- sheffutd.playerClub(dean);
- sheffutd.playerClub(jack);
- sheffutd.playerClub(billy);
- //Leeds players
- Players casilla{ "Francisco", " Casilla", "Goalkeeper", 32, 33 };
- Players liam{ "Liam", " Cooper", "Defender", 30, 28 };
- Players roofe{ "Kemar", " Roofe", "Midfielder", 23, 7 };
- leeds.playerClub(casilla);
- leeds.playerClub(roofe);
- leeds.playerClub(billy);
- //wba players
- Players alex{ "Alex", " Palmer", "Goalkeeper", 22, 1 };
- Players tyrone{ "Tyrone", " Mears", "Defender", 36, 12 };
- Players sam{ "Sam", " Field", "Midfielder", 20, 28 };
- westbrom.playerClub(alex);
- westbrom.playerClub(tyrone);
- westbrom.playerClub(sam);
- //Middlesbrough players
- Players aden{ "Aden", " Flint", "Defender", 29, 24 };
- Players adam{ "Adam", " Clayton", "Midfielder", 30, 8 };
- Players lewis{ "Lewis", " Wing", "Midfielder", 23, 26 };
- middlesbrough.playerClub(aden);
- middlesbrough.playerClub(adam);
- middlesbrough.playerClub(lewis);
- //La Liga Teams
- Team barcelona{ "Barcelona",1 };
- Team atleticomadrid{ "Atletico Madrid",2 };
- Team realmadrid{ "Real Madrid",3 };
- Team getafe{ "Getafe",4 };
- Team alaves{ "Alaves",5 };
- laliga.clubLeague(barcelona);
- laliga.clubLeague(atleticomadrid);
- laliga.clubLeague(realmadrid);
- laliga.clubLeague(getafe);
- laliga.clubLeague(alaves);
- //Barcelona players
- Players messi{ "Lionel", " Messi", "Attacking Midfielder", 31, 10 };
- Players rakitic{ "Ivan"," Rakitic","Midfielder",31,4 };
- Players pique{ "Gerard"," Pique","Center Back",32,3 };
- barcelona.playerClub(messi);
- barcelona.playerClub(rakitic);
- barcelona.playerClub(pique);
- //Atletico Madrid Players
- Players costa{ "Diego", " Costa","Forward",30,19 };
- Players correa{ "Angel"," Correa","Midfielder",24,10 };
- Players godin{ "Diego"," Godin","Defender",33,2 };
- atleticomadrid.playerClub(costa);
- atleticomadrid.playerClub(correa);
- atleticomadrid.playerClub(godin);
- //Real Madrid Players
- Players benzema{ "Karim"," Benzema","Attacker",31,9 };
- Players bale{ "Gareth"," Bale","Attacker",29,11 };
- Players kroos{ "Toni"," Kroos","Midfielder",29,8 };
- realmadrid.playerClub(benzema);
- realmadrid.playerClub(bale);
- realmadrid.playerClub(kroos);
- //Getafe Players
- Players foulquier{ "Dimitri"," Foulquier","Defender",25,24 };
- Players maksimovic{ "Nemanja", " Maksimovic", "Midfielder",24,20 };
- Players chichizola{ "Leandro", " Chichizola", "Goalkeeper", 28,1 };
- getafe.playerClub(foulquier);
- getafe.playerClub(maksimovic);
- getafe.playerClub(chichizola);
- //Alaves Players
- Players takashi{ "Inui", " Takashi", "Midfielder", 30,11 };
- Players maripan{ "Guillermo", " Maripan", "Defender",24,6 };
- Players guidetti{ "John", " Guidetti","Attacker",26,10 };
- alaves.playerClub(takashi);
- alaves.playerClub(maripan);
- alaves.playerClub(guidetti);
- //Segunda division teams
- Team osasuna{ "Osasuna", 1 };
- Team granada{ "Granada", 2 };
- Team deportivo{ "Deportivo", 3 };
- Team malaga{ "Malaga", 4 };
- Team mallorca{ "RCD Mallorca", 5 };
- secunda.clubLeague(osasuna);
- secunda.clubLeague(granada);
- secunda.clubLeague(deportivo);
- secunda.clubLeague(malaga);
- secunda.clubLeague(mallorca);
- //Osasuna players
- Players juan{ "Juan", " Perez", "Goalkeeper", 22, 26 };
- Players nacho{ "Nacho", " Vidal", "Defender", 23, 2 };
- Players fran{ "Fran", " Merida", "Midfielder", 29, 8 };
- osasuna.playerClub(juan);
- osasuna.playerClub(nacho);
- osasuna.playerClub(fran);
- //Granada players
- Players rui{ "Rui", " Silva", "Goalkeeper", 25, 1 };
- Players victor{ "Victor", " Diaz", "Defender", 30, 16 };
- Players carlos{ "Neva", " Carlos", "Defender", 22, 31 };
- granada.playerClub(rui);
- granada.playerClub(nacho);
- granada.playerClub(fran);
- //Deportivo players
- Players vitor{ "Vitor", " Silva", "Midfielder", 35, 6 };
- Players valle{ "Borja", " Valle", "Attacker", 26, 19 };
- Players christian{ "Christian", " Church", "Attacker", 30, 9 };
- deportivo.playerClub(vitor);
- deportivo.playerClub(valle);
- deportivo.playerClub(christian);
- //Malaga players
- Players werner{ "Alex", " Werner", "Goalkeeper", 23, 1 };
- Players torres{ "Miguel", " Torres", "Defender", 33, 23 };
- Players keidi{ "Keidi", " Bare", "Midfielder", 21, 35 };
- malaga.playerClub(werner);
- malaga.playerClub(torres);
- malaga.playerClub(keidi);
- //Mallorca players
- Players manolo{ "Manolo", " Reina", "Goalkeeper", 33, 1 };
- Players salva{ "Salva", " Ruiz", "Defender", 23, 17 };
- Players ante{ "Ante", " Budimir", "Midfielder", 27, 22 };
- mallorca.playerClub(manolo);
- mallorca.playerClub(salva);
- mallorca.playerClub(ante);
- //Macedonia First League teams
- Team shkendija{ "Shkendija", 1 };
- Team pandev{ "Akademija Pandev", 2 };
- Team vardar{ "FK Vardar", 3 };
- Team shkupi{ "Shkupi", 4 };
- Team rabotnicki{ "Rabotnicki", 5 };
- league1.clubLeague(shkendija);
- league1.clubLeague(pandev);
- league1.clubLeague(vardar);
- league1.clubLeague(shkupi);
- league1.clubLeague(rabotnicki);
- //Shkendija Players
- Players ibraimi{ "Agim"," Ibraimi","Midfielder",30,10 };
- Players besart{ "Besart"," Ibraimi","Forward",32,7 };
- Players armend{ "Armend", " Alimi", "Midfielder",31,5 };
- shkendija.playerClub(ibraimi);
- shkendija.playerClub(besart);
- shkendija.playerClub(armend);
- //Akademija pandev players
- Players aleksandar{ "Aleksandar"," Mishov","Forward",20,9 };
- Players nikola{ "Nikola","Spasov"," Midfielder",19,15 };
- Players vane{ "Vane","Jovanov"," Defender",20,2 };
- pandev.playerClub(aleksandar);
- pandev.playerClub(nikola);
- pandev.playerClub(vane);
- //Vardar Players
- Players xhemal{ "Xhemal","Ibishi"," Midfielder",18,46 };
- Players ali{ "Ali" , "Adem"," Midfielder",18,34 };
- Players maksim{ "Maksim","Maksimov"," Attacker",23,9 };
- vardar.playerClub(xhemal);
- vardar.playerClub(ali);
- vardar.playerClub(maksim);
- //Shkupi Players
- Players amir{ "Amir"," Bilali","Defender",24,4 };
- Players suat{ "Suat"," Zendeli","Goalkeeper",38,1 };
- Players muharem{ "Muharem"," Bajrami","Defender",33,5 };
- shkupi.playerClub(amir);
- shkupi.playerClub(suat);
- shkupi.playerClub(muharem);
- //Rabotnicki Players
- Players blaze{ "Dejan"," Blazebski","Forward",33,9 };
- Players petar{ "Petar"," Petkovski","Forward",22,7 };
- Players nikolaj{ "Nikolaj"," Dyulgerov","Midfielder",31,8 };
- rabotnicki.playerClub(blaze);
- rabotnicki.playerClub(petar);
- rabotnicki.playerClub(nikolaj);
- //Macedonia Second League
- Team struga{ "Struga", 1 };
- Team labunishta{ "Labunishta", 2 };
- Team skopje{ "FK Skopje", 3 };
- Team korabi{ "Korabi", 4 };
- Team vellazerimi{ "Vellazerimi 77", 5 };
- league2.clubLeague(struga);
- league2.clubLeague(labunishta);
- league2.clubLeague(skopje);
- league2.clubLeague(korabi);
- league2.clubLeague(vellazerimi);
- //Struga players
- Players tairi{ "Flamur", " Tairi", "Midfielder", 29, 9 };
- Players kaba{ "Dieli", " Kaba", "Attacker", 25, 22 };
- Players loga{ "Altin", " Loga", "Midfielder", 26, 11 };
- struga.playerClub(tairi);
- struga.playerClub(kaba);
- struga.playerClub(loga);
- //Labunishta players
- Players opre{ "Mugni", " Opre", "Goalkeeper", 24, 1 };
- Players saliu{ "Pajazit", " Saliu", "Forward", 28, 7 };
- Players rexhepi{ "Nexhmi", " Rexhepi", "Forward", 24, 10 };
- labunishta.playerClub(opre);
- labunishta.playerClub(saliu);
- labunishta.playerClub(loga);
- //Skopje players
- Players ristovski{ "Milan", " Ristovski", "Midfielder", 25, 10 };
- Players cvetkovski{ "Marjan", "Cvetkovsi", "Goalkeeper", 22, 1 };
- Players fakikj{ "Meris", " Fakikj", "Defender", 26, 16 };
- skopje.playerClub(ristovski);
- skopje.playerClub(cvetkovski);
- skopje.playerClub(loga);
- //futja e ligave ne shtete
- england.leaguestate(epl1);
- england.leaguestate(epl2);
- spain.leaguestate(laliga);
- spain.leaguestate(secunda);
- macedonia.leaguestate(league1);
- macedonia.leaguestate(league2);
- string country;
- cout << "Football leagues" << endl;
- cout << "Choose country to see the leagues: " << endl;
- cout << "1.England " << endl;
- cout << "2.Spain " << endl;
- cout << "3.Macedonia" << endl;
- cin >> country;
- if ((country == "England") || (country == "england"))
- {
- england.print();
- }
- else
- if ((country == "Spain") || (country == "spain"))
- {
- spain.print();
- }
- else
- if ((country == "Macedonia") || (country == "macedonia"))
- {
- macedonia.print();
- }
- else
- {
- cout << "You choose wrong name";
- cin.get(); cin.get();
- return 0;
- }
- cout << "Choose divison: " << endl;
- cin >> division;
- if (division == 1 && (country == "England" || country == "england"))
- {
- epl1.printT();
- }
- else if (division == 2 && (country == "England" || country == "england"))
- {
- epl2.printT();
- }
- else if (division == 1 && (country == "Spain" || country == "spain"))
- {
- laliga.printT();
- }
- else if (division == 2 && (country == "Spain" || country == "spain"))
- {
- secunda.printT();
- }
- else if (division == 1 && (country == "macedonia" || country == "Macedonia"))
- {
- league1.printT();
- }
- else if (division == 2 && (country == "macedonia" || country == "Macedonia"))
- {
- league2.printT();
- }
- cout << "\nChoose team: " << endl;
- cin >> club;
- if (club == 1 && division == 1 && (country == "England" || country == "england"))
- {
- liverpool.printPlayers();
- }
- if(club == 2 && division == 1 && (country == "England" || country == "england"))
- {
- mancity.printPlayers();
- }
- if (club == 3 && division == 1 && (country == "England" || country == "england"))
- {
- tottenham.printPlayers();
- }
- if (club == 4 && division == 1 && (country == "England" || country == "england"))
- {
- arsenal.printPlayers();
- }
- if (club == 5 && division == 1 && (country == "England" || country == "england"))
- {
- manunited.printPlayers();
- }
- if (club == 1 && division == 2 && (country == "England" || country == "england")) {
- norwich.printPlayers();
- }
- if (club == 2 && division == 2 && (country == "England" || country == "england")) {
- sheffutd.printPlayers();
- }
- if (club == 3 && division == 2 && (country == "England" || country == "england")) {
- leeds.printPlayers();
- }
- if (club == 4 && division == 2 && (country == "England" || country == "england")) {
- westbrom.printPlayers();
- }
- if (club == 5 && division == 2 && (country == "England" || country == "england")) {
- middlesbrough.printPlayers();
- }
- if (club == 1 && division == 1 && (country == "spain" || country == "Spain")) {
- barcelona.printPlayers();
- }
- if (club == 2 && division == 1 && (country == "spain" || country == "Spain")) {
- atleticomadrid.printPlayers();
- }
- if (club == 3 && division == 1 && (country == "spain" || country == "Spain")) {
- realmadrid.printPlayers();
- }
- if (club == 4 && division == 1 && (country == "spain" || country == "Spain")) {
- getafe.printPlayers();
- }
- if (club == 5 && division == 1 && (country == "spain" || country == "Spain")) {
- alaves.printPlayers();
- }
- if (club == 1 && division == 2 && (country == "spain" || country == "Spain")) {
- osasuna.printPlayers();
- }
- if (club == 2 && division == 2 && (country == "spain" || country == "Spain")) {
- granada.printPlayers();
- }
- if (club == 3 && division == 2 && (country == "spain" || country == "Spain")) {
- deportivo.printPlayers();
- }
- if (club == 4 && division == 2 && (country == "spain" || country == "Spain")) {
- malaga.printPlayers();
- }
- if (club == 5 && division == 2 && (country == "spain" || country == "Spain")) {
- mallorca.printPlayers();
- }
- if (club == 1 && division == 1 && (country == "macedonia" || country == "Macedonia")) {
- shkendija.printPlayers();
- }
- if (club == 2 && division == 1 && (country == "macedonia" || country == "Macedonia")) {
- pandev.printPlayers();
- }
- if (club == 3 && division == 1 && (country == "macedonia" || country == "Macedonia")) {
- vardar.printPlayers();
- }
- if (club == 4 && division == 1 && (country == "macedonia" || country == "Macedonia")) {
- shkupi.printPlayers();
- }
- if (club == 5 && division == 1 && (country == "macedonia" || country == "Macedonia")) {
- rabotnicki.printPlayers();
- }
- if (club == 1 && division == 2 && (country == "macedonia" || country == "Macedonia")) {
- struga.printPlayers();
- }
- if (club == 2 && division == 2 && (country == "macedonia" || country == "Macedonia")) {
- labunishta.printPlayers();
- }
- if (club == 3 && division == 2 && (country == "macedonia" || country == "Macedonia")) {
- skopje.printPlayers();
- }
- cin.get(); cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement