Minicricinfo in c++ by Arslaan Muhammad Ali
if you have any query regarding c++ programmer dont't hesitate to contact me on here
https://www.facebook.com/invigorating.arslaan
so here are the specificattions:
if you have any query regarding c++ programmer dont't hesitate to contact me on here
https://www.facebook.com/invigorating.arslaan
so here are the specificattions:
Mini‐Cricinfo
Here we go: This time we’ll make mini‐cricinfo.com
☺
Maintain the
structures of the cricket players to such that for the following functionality
I should be able
to perform every possible following tasks.
There should be
different teams with respect to each country let’s say 6 countries: you can
take the top 6 countries cricket ranking countries and maintain the records for
each country.
Here is the Idea
you have the following one struct
Struct Player{
char* Name ; // dynamically allocated
char* country;
.
.
};
Here is the
Players list you have in another structure:
struct
PlayersRecord
{
Player * AllPlayers; // Players will be allocated once no more
again
int Size;
.
. // Whatever you should think it should come here
.
}
Maintain 6
structures, the array of structures, with respect to each country:
struct
CountryTeamPlayers
{
Player ** AllCountryPlayers;
/*
All the players here will not be allocated rather all these
entries will be pointing to the
players allocated in the Players Record list
*/
char* CountryName;
int size;
.
.
.
long double TeamTotalScore;
/*
so far assume the team score is the summation of all the players
so far played in that
team… no extras like wide balls no balls byes.. */
}
Here are the
following functionalities we require.
• Write a data
entry function for loading all the entries from the file “Records.txt”:
Data should be
loaded only in the PlayersRecord struct.
• Make a function
which take a parameter PlayersRecord struct(as passed by reference) also
it should take another parameter CountryTeamPlayers (struct byreference,
with name of the country assigned) and this function should allocatethe
Player* array dynamically to such that every entry should be pointing to
theplayer of that specific country player.
o Make a function which will call for each country structure and
update thatstruct.
• Update a new
player added and correspondingly its country should be updated too.
• Write a
function which will print the team with highest score so far.
• Write a
function which will output the Team with highest number of centuries so far.
• Display the
batting average of each country
• update Match
Info: Define a file format of any match happened between two teams: such that
update
• Country which
have highest number of Captains: the most inconsistent team.
Obviously that
should be whom “…….”? But your function should find that team.
• Display the
strongest team: whose average score of the team is the highest one.
• Display the
best players 11 team of each country for coming 20‐20 world cup, with highest
average and strike rate, Note you have to be very careful for it as I don’t
want Haneef Muhammad or Javed Miandad or Imran to play now, so the potential
world cup team should be such that the Age of each player should be less then
35. Similarly for each team printout on the screen or file the potential teams
for each country.
solution for this problem is below what you need to do is make your own text files in the code
#include <fstream>
#include <iostream>
#include <iomanip>
#include <windows.h>
#include <conio.h>
using namespace std;
struct Player
{
char* name; // dynamically allocated
char* country;
int mat;
int inns;
int no;
int runs;
int hs;
float ave;
int hund;
int fifty;
int fours;
int sixs;
int age;
int sr;
bool captain;
};
struct Country
{
char* Cname;
Player* Players; // This contains the Country Players Array Dynamically grows every time new record added
int size;
};
struct Record
{
Country* Countries; // Lets say we have only Got 6 Countries
int size;
};
void menu(Record r);
Player* reading_from_file(int & players_size,char* file_name)
{
ifstream fin(file_name);
char* temp=new char[101],ch=' ';
int i=0;
Player* player=new Player;
while(!fin.eof())
{
players_size++;
fin.getline(temp,100,'.');
Player* temp_player=new Player[players_size];
for(int j=0;j<players_size-1;j++)
{
temp_player[j].name=new char[strlen(player[j].name)+1];
temp_player[j].country=new char[strlen(player[j].country)+1];
strcpy(temp_player[j].name,player[j].name);
strcpy(temp_player[j].country,player[j].country);
temp_player[j].mat=player[j].mat;temp_player[j].inns=player[j].inns;temp_player[j].no=player[j].no;temp_player[j].runs=player[j].runs;temp_player[j].hs=player[j].hs;temp_player[j].ave=player[j].ave;temp_player[j].hund=player[j].hund;temp_player[j].fifty=player[j].fifty;temp_player[j].fours=player[j].fours;temp_player[j].sixs=player[j].sixs;temp_player[j].age=player[j].age;temp_player[j].sr=player[j].sr;temp_player[j].captain=player[j].captain;
}
temp_player[i].name=new char[strlen(temp)+1];
strcpy(temp_player[i].name,temp);
fin.getline(temp,100,'.');
temp_player[i].country=new char[strlen(temp)+1];
strcpy(temp_player[i].country,temp);
fin>>temp_player[i].mat>>temp_player[i].inns>>temp_player[i].no>>temp_player[i].runs>>temp_player[i].hs>>temp_player[i].ave>>temp_player[i].hund>>temp_player[i].fifty>>temp_player[i].fours>>temp_player[i].sixs>>temp_player[i].age>>temp_player[i].sr>>temp_player[i].captain;
for(int j=0;j<players_size-1;j++)
{
delete [] player[j].name;
delete [] player[j].country;
}
delete [] player;
player=temp_player;
fin.get(ch);
while((ch==' ' || ch=='\n') && !fin.eof())
{
fin.get(ch);
}
if(ch!=' ' && ch!='\n' && !fin.eof())
{
fin.unget();
}
i++;
}
return player;
}
Record manage_countries(Player* player,int size)
{
bool valid=false;
int count=0;
char** c=new char*[size];
c[0]=new char[strlen(player[0].country)+1];
count++;
strcpy(c[0],player[0].country);
for(int i=0;i<size;i++)
{
for(int j=0;j<count;j++)
{
if(strcmp(c[j],player[i].country)==0)
{
valid=false;
break;
}
else
{
valid=true;
}
}
if(valid)
{
count++;
c[count-1]=new char[strlen(player[i].country)+1];
strcpy(c[count-1],player[i].country);
}
}
Record r1;
r1.Countries=new Country[count];
for(int i=0;i<count;i++)
{
r1.Countries[i].Cname=new char [strlen(c[i])+1];
strcpy(r1.Countries[i].Cname,c[i]);
delete[] c[i];
}
delete[]c;
int country_player_size=0;
for(int i=0;i<count;i++)
{
r1.Countries[i].size=0;
for(int j=0;j<size;j++)
{
if(strcmp(r1.Countries[i].Cname,player[j].country)==0)
{
r1.Countries[i].size++;
}
}
r1.Countries[i].Players=new Player[r1.Countries[i].size];
for(int j=0,counter=0;j<size;j++)
{
if(strcmp(r1.Countries[i].Cname,player[j].country)==0)
{
r1.Countries[i].Players[counter]=player[j];
counter++;
}
}
}
r1.size=0;
r1.size=count;
return r1;
}
void update_new_player(Record &r)
{
Player* player=new Player;
char* temp=new char [201],dummy;
cin.get(dummy);
cout<<"Enter player name :- ";
cin.getline(temp,200,'\n');
player->name=new char[strlen(temp)+1];
strcpy(player->name,temp);
cout<<"Enter Country name :- ";
cin.getline(temp,200,'\n');
player->country=new char[strlen(temp)+1];
strcpy(player->country,temp);
delete[]temp;
cout<<"Enter number of matches :- ";
cin>>player->mat;
cout<<"Enter number of Innings :- ";
cin>>player->inns;
cout<<"Enter player no. :- ";
cin>>player->no;
cout<<"Enter Total runs :- ";
cin>>player->runs;
cout<<"Enter Highest score :- ";
cin>>player->hs;
cout<<"Enter average :- ";
cin>>player->ave;
cout<<"Enter number of Hundreds :- ";
cin>>player->hund;
cout<<"Enter number of Fifties :- ";
cin>>player->fifty;
cout<<"Enter number of fours :- ";
cin>>player->fours;
cout<<"Enter number of sixes :- ";
cin>>player->sixs;
cout<<"Enter Player age :- ";
cin>>player->age;
cout<<"Enter Player Strike Rate :- ";
cin>>player->sr;
cout<<"Enter Captain status (0 for false and 1 for true) :- ";
cin>>player->captain;
int i;
for(i=0;i<r.size;i++)
{
if(strcmp(r.Countries[i].Cname,player->country)==0)
{
r.Countries[i].size++;
break;
}
}
int size=0;
Country* tem=new Country;
tem->Players=new Player[r.Countries[i].size];
tem->Cname=new char [strlen(r.Countries[i].Cname)+1];
tem->size=r.Countries[i].size;
int j;
for(j=0;j<r.Countries[i].size-1;j++)
{
tem->Players[j].name=new char[strlen(r.Countries[i].Players[j].name)+1];
strcpy(tem->Players[j].name,r.Countries[i].Players[j].name);
tem->Players[j].country=new char[strlen(r.Countries[i].Players[j].country)+1];
strcpy(tem->Players[j].country,r.Countries[i].Players[j].country);
tem->Players[j].mat=r.Countries[i].Players[j].mat;tem->Players[j].inns=r.Countries[i].Players[j].inns;tem->Players[j].no=r.Countries[i].Players[j].no;tem->Players[j].runs=r.Countries[i].Players[j].runs;tem->Players[j].hs=r.Countries[i].Players[j].hs;tem->Players[j].ave=r.Countries[i].Players[j].ave;tem->Players[j].hund=r.Countries[i].Players[j].hund;tem->Players[j].fifty=r.Countries[i].Players[j].fifty;tem->Players[j].fours=r.Countries[i].Players[j].fours;tem->Players[j].sixs=r.Countries[i].Players[j].sixs;tem->Players[j].age=r.Countries[i].Players[j].age;tem->Players[j].sr=r.Countries[i].Players[j].sr;tem->Players[j].captain=r.Countries[i].Players[j].captain;
}
tem->Players[j].name=new char[strlen(player->name)+1];
strcpy(tem->Players[j].name,player->name);
tem->Players[j].country=new char[strlen(player->country)+1];
strcpy(tem->Players[j].country,player->country);
tem->Players[j].mat=player->mat;tem->Players[j].inns=player->inns;tem->Players[j].no=player->no;tem->Players[j].runs=player->runs;tem->Players[j].hs=player->hs;tem->Players[j].ave=player->ave;tem->Players[j].hund=player->hund;tem->Players[j].fifty=player->fifty;tem->Players[j].fours=player->fours;tem->Players[j].sixs=player->sixs;tem->Players[j].age=player->age;tem->Players[j].sr=player->sr;tem->Players[j].captain=player->captain;
for(j=0;j<r.Countries[i].size-1;j++)
{
delete[] r.Countries[i].Players[j].name;
delete[] r.Countries[i].Players[j].country;
}
delete[] r.Countries[i].Players;
r.Countries[i].Players=new Player[r.Countries[i].size];
for(j=0;j<tem->size;j++)
{
r.Countries[i].Players[j].name=new char[strlen(tem->Players[j].name)+1];
strcpy(r.Countries[i].Players[j].name,tem->Players[j].name);
r.Countries[i].Players[j].country=new char[strlen(tem->Players[j].country)+1];
strcpy(r.Countries[i].Players[j].country,tem->Players[j].country);
r.Countries[i].Players[j].mat=tem->Players[j].mat;r.Countries[i].Players[j].inns=tem->Players[j].inns;r.Countries[i].Players[j].no=tem->Players[j].no;r.Countries[i].Players[j].runs=tem->Players[j].runs;r.Countries[i].Players[j].hs=tem->Players[j].hs;r.Countries[i].Players[j].ave=tem->Players[j].ave;r.Countries[i].Players[j].hund=tem->Players[j].hund;r.Countries[i].Players[j].fifty=tem->Players[j].fifty;r.Countries[i].Players[j].fours=tem->Players[j].fours;r.Countries[i].Players[j].sixs=tem->Players[j].sixs;r.Countries[i].Players[j].age=tem->Players[j].age;r.Countries[i].Players[j].sr=tem->Players[j].sr;r.Countries[i].Players[j].captain=tem->Players[j].captain;
}
for(j=0;j<r.Countries[i].size;j++)
{
delete[] tem->Players[j].name;
delete[] tem->Players[j].country;
}
delete[] tem->Players;
delete[] tem->Cname;
delete tem;
}
void display_player(Player Players)
{
cout<<"Player name :- "<<Players.name<<endl;
cout<<"Country name :- "<<Players.country;
cout<<"\nMat Inns No runs Hs Ave Hund Fifty Fours sixes Age Captain SR\n";
cout<<Players.mat<<setw(5)<<Players.inns<<setw(5)<<Players.no<<setw(5)<<Players.runs<<setw(5)<<Players.hs<<setw(5)<<Players.ave<<setw(5)<<Players.hund<<setw(5)<<Players.fifty<<setw(5)<<Players.fours<<setw(5)<<Players.sixs<<setw(5)<<Players.age<<setw(5)<<Players.sr<<setw(5)<<Players.captain;
cout<<"\n\n";
}
void display_team_page(Record r)
{
char* tem=new char[201],dummy;
cin.get(dummy);
cout<<"Enter team name in title mode :- ";
cin.getline(tem,200,'\n');
int i=0;
for(i=0;i<r.size;i++)
{
if(strcmp(r.Countries[i].Cname,tem)==0)
{
break;
}
}
for(int j=0;j<r.Countries[i].size;j++)
{
display_player(r.Countries[i].Players[j]);
}
delete[]tem;
}
void display_highest_score(Record r)
{
int* arr=new int [r.size];
for(int i=0;i<r.size;i++)
{
arr[i]=0;
}
for(int i=0;i<r.size;i++)
{
for(int j=0;j<r.Countries[i].size;j++)
{
arr[i]+=r.Countries[i].Players[j].hs;
}
}
int i,j;
for(i=1,j=0;i<r.size;i++)
{
if(arr[j]<arr[i])
{
j=i;
}
}
cout<<"The team with highest Score is :- "<<r.Countries[j].Cname<<endl;
delete [] arr;
}
void display_team_with_highest_no_of_centuries(Record r)
{
int* arr=new int [r.size];
for(int i=0;i<r.size;i++)
{
arr[i]=0;
}
for(int i=0;i<r.size;i++)
{
for(int j=0;j<r.Countries[i].size;j++)
{
arr[i]+=r.Countries[i].Players[j].hund;
}
}
int i,j;
for(i=1,j=0;i<r.size;i++)
{
if(arr[j]<arr[i])
{
j=i;
}
}
for(int k=0;k<r.size;k++)
{
cout<<r.Countries[k].Cname<<" ";
cout<<arr[k]<<endl;
}
cout<<"The team with highest Highest number of Centuries is :- "<<r.Countries[j].Cname<<endl;
delete [] arr;
}
void display_batting_average(Record r)
{
float* arr=new float [r.size];
for(int i=0;i<r.size;i++)
{
arr[i]=0;
}
for(int i=0;i<r.size;i++)
{
for(int j=0;j<r.Countries[i].size;j++)
{
arr[i]+=r.Countries[i].Players[j].ave;
}
arr[i]/=r.Countries[i].size;
}
for(int k=0;k<r.size;k++)
{
cout<<"The Batting Average of "<<r.Countries[k].Cname<<" is ";
cout<<arr[k]<<endl;
}
delete [] arr;
}
void display_strongest_team(Record r)
{
float* arr=new float [r.size];
for(int i=0;i<r.size;i++)
{
arr[i]=0;
}
for(int i=0;i<r.size;i++)
{
for(int j=0;j<r.Countries[i].size;j++)
{
arr[i]+=r.Countries[i].Players[j].ave;
}
arr[i]/=r.Countries[i].size;
}
int i,j;
for(i=1,j=0;i<r.size;i++)
{
if(arr[j]<arr[i])
{
j=i;
}
}
for(int k=0;k<r.size;k++)
{
cout<<r.Countries[k].Cname<<" ";
cout<<arr[k]<<endl;
}
cout<<"The Strongest team is "<<r.Countries[j].Cname<<endl;
delete[]arr;
}
void test_match_team(Country country)
{
float* arr=new float [country.size];
for(int i=0;i<country.size;i++)
{
arr[i]=0;
}
for(int i=0;i<country.size;i++)
{
arr[i]+=country.Players[i].ave;
arr[i]+=country.Players[i].age;
}
int* ptr=new int[country.size];
for(int i=0;i<country.size;i++)
{
ptr[i]=i;
}
for(int i=0;i<country.size;i++)
{
for(int k=i+1;k<country.size;k++)
{
if(arr[i]<arr[k])
{
swap(ptr[i],ptr[k]);
swap(arr[i],arr[k]);
}
}
}
for(int i=11;i<country.size;i++)
{
ptr[i]=-1;
}
for(int i=0;i<11;i++)
{
display_player(country.Players[ptr[i]]);
}
delete[]arr;
delete[]ptr;
}
void delete_player(Record &r)
{
char* arr=new char [201],dummy;
cin.get(dummy);
cout<<"Enter Player Name to be Deleted :- ";
cin.getline(arr,200,'\n');
int i,j;
for(i=0;i<r.size;i++)
{
for(j=0;j<r.Countries[i].size;j++)
{
if(strcmp(r.Countries[i].Players[j].name,arr)==0)
{
break;
}
}
if(j<r.Countries[i].size)
{
if(strcmp(r.Countries[i].Players[j].name,arr)==0)
{
break;
}
}
}
if(i==r.size)
{
cout<<"Player mismatch";
return;
}
r.Countries[i].size--;
Player* temp_player=new Player[r.Countries[i].size];
for(int x=0,y=0;x<r.Countries[i].size;y++,x++)
{
if(y==j)
{
y++;
}
temp_player[x].name=new char[strlen(r.Countries[i].Players[y].name)+1];
temp_player[x].country=new char[strlen(r.Countries[i].Players[y].country)+1];
strcpy(temp_player[x].name,r.Countries[i].Players[y].name);
strcpy(temp_player[x].country,r.Countries[i].Players[y].country);
temp_player[x].mat=r.Countries[i].Players[y].mat;temp_player[x].inns=r.Countries[i].Players[y].inns;temp_player[x].no=r.Countries[i].Players[y].no;temp_player[x].runs=r.Countries[i].Players[y].runs;temp_player[x].hs=r.Countries[i].Players[y].hs;temp_player[x].ave=r.Countries[i].Players[y].ave;temp_player[x].hund=r.Countries[i].Players[y].hund;temp_player[x].fifty=r.Countries[i].Players[y].fifty;temp_player[x].fours=r.Countries[i].Players[y].fours;temp_player[x].sixs=r.Countries[i].Players[y].sixs;temp_player[x].age=r.Countries[i].Players[y].age;temp_player[x].sr=r.Countries[i].Players[y].sr;temp_player[x].captain=r.Countries[i].Players[y].captain;
}
for(int z=0;z<r.Countries[i].size+1;z++)
{
delete[]r.Countries[i].Players[z].name;
delete[]r.Countries[i].Players[z].country;
}
delete[]r.Countries[i].Players;
r.Countries[i].Players=temp_player;
}
void display_players_for_T20(Record r)
{
float** ptr=new float*[r.size];
int ** arr=new int*[r.size];
for(int i=0;i<r.size;i++)
{
ptr[i]=new float[r.Countries[i].size];
arr[i]=new int [r.Countries[i].size];
for(int j=0;j<r.Countries[i].size;j++)
{
arr[i][j]=j;
ptr[i][j]=0;
ptr[i][j]+=r.Countries[i].Players[j].ave;
ptr[i][j]+=r.Countries[i].Players[j].sr/10;
}
}
for(int i=0;i<r.size;i++)
{
for(int j=0;j<r.Countries[i].size;j++)
{
for(int k=j+1;k<r.Countries[i].size;k++)
{
if(ptr[i][j]<ptr[i][k])
{
swap(ptr[i][j],ptr[i][k]);
swap(arr[i][j],arr[i][k]);
}
}
}
}
for(int i=0;i<r.size;i++)
{
for (int j=0;j<11;j++)
{
if(r.Countries[i].Players[j].age<35)
{
display_player(r.Countries[i].Players[j]);
}
}
}
}
void display_team_with_highest_number_of_captains(Record r)
{
int* arr=new int[r.size];
for(int count=0;count<r.size;count++)
{
arr[count]=0;
}
for(int i=0;i<r.size;i++)
{
for(int j=0;j<r.Countries[i].size;j++)
{
if(r.Countries[i].Players[j].captain==true)
{
arr[i]+=1;
}
}
}
int x=0;
for(int k=1;k<r.size;k++)
{
if(arr[x]<arr[k])
{
x=k;
}
}
cout<<"The team with highest number of Captains is "<<r.Countries[x].Cname<<" with "<<arr[x]<<endl;
}
char *input_filename;
bool first_input=true;
bool validity()
{
ifstream fin;
fin.open(input_filename);
if(!fin.is_open())
return false;
else
fin.close();
return true;
}
void take_filename()
{
int size=1,x=0,i=0;
char dummy;
char *temp=nullptr;
input_filename=new char[size];
cin>>dummy;
while(dummy!='\n')
{
input_filename[x]=dummy;
temp=new char[size];
for(int y=0;y<size;y++)
temp[y]=input_filename[y];
delete [] input_filename;
size++;
input_filename=new char[size];
for(int y=0;y<size-1;y++)
input_filename[y]=temp[y];
delete[]temp;
x++;
cin.get(dummy);
}
input_filename[x]='\0';
}
void first_consoleinput(int answer,Record r)
{
if((answer>1 && answer<14) && first_input==true)
{
cout<<"\n\tPlease First load data file........."<<endl;
Sleep(500);
menu(r);
}
else if(answer==1)
{
cout<<"\n\nPlease Enter input file name: ";
bool valid=false;
while(!valid)
{
take_filename();
valid=validity();
if(!valid)
cout<<"Program is not accessing input file\n\tPlease Again enter input file name: ";
first_input=false;
}
cout<<"\n\n\tInput file loaded successfully"<<endl;
int players_size=0;
Player* player=nullptr;
player=reading_from_file(players_size,input_filename);
r=manage_countries(player,players_size);
menu(r);
}
else if(answer==14)
cout<<"\n\n\n\t\tTHANKS , ALLAH HAFIZ\n"<<endl;
else if(answer<1 && answer>12)
{
cout<<"\n\t\tWrong Entry"<<endl;
Sleep(500);
menu(r);
}
else if(answer>1 && answer<=13)
{
if(answer==2)
{
update_new_player(r);
menu(r);
}
else if(answer==3)
{
display_highest_score(r);
menu(r);
}
else if(answer==4)
{
display_strongest_team(r);
menu(r);
}
else if(answer==5)
{
display_batting_average(r);
menu(r);
}
else if(answer==6)
{
display_team_with_highest_no_of_centuries(r);
menu(r);
}
else if(answer==8)
{
display_team_page(r);
menu(r);
}
else if(answer==9)
{
char* tem=new char[201],dummy;
cin.get(dummy);
cout<<"Enter Team name in title mode :- ";
cin.getline(tem,200,'\n');
int i=0,j;
for(i=0;i<r.size;i++)
{
if(strcmp(r.Countries[i].Cname,tem)==0)
{
break;
}
}
test_match_team(r.Countries[i]);
delete[]tem;
menu(r);
}
else if(answer==10)
{
delete_player(r);
menu(r);
}
else if(answer==11)
{
display_players_for_T20(r);
menu(r);
}
else if(answer==12)
{
char* tem=new char[201],dummy;
cin.get(dummy);
cout<<"Enter Player name in title mode :- ";
cin.getline(tem,200,'\n');
int i=0,j=0;
for(i=0;i<r.size;i++)
{
for(j=0;j<r.Countries[i].size;j++)
{
if(strcmp(r.Countries[i].Players[j].name,tem)==0)
{
break;
}
}
if(j<r.Countries[i].size)
{
if(strcmp(r.Countries[i].Players[j].name,tem)==0)
{
break;
}
}
}
if(i==r.size)
{
cout<<"Player mismatch";
delete[]tem;
menu(r);
}
display_player(r.Countries[i].Players[j]);
delete[]tem;
menu(r);
}
else if(answer==13)
{
display_team_with_highest_number_of_captains(r);
menu(r);
}
}
}
void welcome_screen(int &answer)
{
system("color 4B");
cout<<"\t\t\t Welcome To Mini CricInfo ! \n\n"<<endl;
cout<<" Press key : \n\n"<<endl;
cout<<"\t 1 - Load Input File Name "<<endl;
cout<<"\t 2 - Add Player "<<endl;
cout<<"\t 3 - Display team having Highest Score "<<endl;
cout<<"\t 4 - Display The Strongest Team "<<endl;
cout<<"\t 5 - Display the Batting Average of Country "<<endl;
cout<<"\t 6 - Display Country with highest number of Centuries "<<endl;
cout<<"\t 8 - Display Team Page "<<endl;
cout<<"\t 9 - Display test Match Team "<<endl;
cout<<"\t 10 - Delete Player "<<endl;
cout<<"\t 11 - Display Best 11 Players for T20 world cup "<<endl;
cout<<"\t 12 - Display Player "<<endl;
cout<<"\t 13 - Display Team with highest number of captains "<<endl;
cout<<"\t 14 - Exit "<<endl;
cout<<"\t-----------------------------------------------------------------\n\n"<<endl;
cout<<"Your Choice: ";
cin>>answer;
}
void menu(Record r)
{
cout<<"Press any key to continue....";
getch();
system("cls");
int input=-1;
welcome_screen(input);
first_consoleinput(input,r);
}
int main()
{
Record r;
input_filename="Records.txt";
Player* player=nullptr;
int players_size=0;
player=reading_from_file(players_size,input_filename);
r=manage_countries(player,players_size);
menu(r);
system("pause");
return 0;
}
Comments
Post a Comment