0% found this document useful (0 votes)
45 views3 pages

Cricket Score

The document contains C++ code to record details of a cricket match such as venue, teams, toss winner, date, batting scorecard, and bowling analysis. It prompts the user to input these details and prints a score sheet summarizing the key information including venue, teams, toss winner, date, individual batting scores, and bowling figures for each bowler.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

Cricket Score

The document contains C++ code to record details of a cricket match such as venue, teams, toss winner, date, batting scorecard, and bowling analysis. It prompts the user to input these details and prints a score sheet summarizing the key information including venue, teams, toss winner, date, individual batting scores, and bowling figures for each bowler.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#include <iostream>

#include<cstdlib>
using namespace std;
int main()
{
system("color 14");
string venue;
string teams;
string won;
string lose;
int date;
cout<<"Enter a venue :";
getline(cin,venue);
cout<<"Match between by :";
getline(cin,teams);
cout<<"Toss won by :";
getline(cin,won);
cout<<"Toss lose by :";
getline(cin,lose);
cout<<"Enter a date :";
cin>>date;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"competition:"<<" "<<"||"<<"Venue :"<<venue<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Match Between:"<<" "<<"||"<<"Versus :"<<teams<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Toss won by:"<<" "<<"||"<<"Elected to :"<<won<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Inning of:1"<<" "<<"||"<<"Date :"<<date<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Batting side"<<" "<<"||"<<won<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
int dan,one,two,four,six,run;
cout<<"How many batsman :";
cin>>dan;
string namepl;
getline(cin,namepl);
for(int i=1;i<=dan;i++)
{
cout<<endl<<"Name of batsman:"<<i<<":";
cin>>namepl;
cout<<endl;
cout<<"One run:";
cin>>one;
cout<<endl;
cout<<"Two run:";
cin>>two;
cout<<endl<<"How many batsman hit fours :";
cin>>four;
cout<<endl;
cout<<endl<<"How many batsman hit sixes :";
cin>>six;
cout<<endl;
cout<<endl<<"Total runs to batsman: ";
run=(one+two+four+six);
cout<<run;
cout<<endl;
cout<<"______________________________________________"<<endl;
cout<<"Batsman name"<<" "<<"||"<<"-1s"<<" "<<"||"<<"-2s"<<" "<<"||"<<"-4s"<<"
"<<"||"<<"-6s"<<" "<<"||"<<"Total runs"<<endl;
cout<<"______________________________________________"<<endl;
cout<<"namepl"<<" "<<"||"<<"one"<<" "<<"||"<<"two"<<" "<<"||"<<"four"<<"
"<<"||"<<"six"<<" "<<"||"<<"run"<<endl;
cout<<"______________________________________________"<<endl;
cout<<""<<"Bowling side "<<"||"<<lose <<""<<endl;
cout<<"______________________________________________"<<endl;
int bowl,maiden,over,out, runs,bowler;
float average =0.0;
cout<<"How many bowlers";
cin>>bowl;
string name;
getline(cin,name);
for(int i=1;i<=bowl;i++)
{
cout<<endl<<"Name of bowlers"<<""<<"No"<<i<<""<<":";
cin>>name;
cout<<endl<<"How many overs of bowlers"<<""<<"No"<<i<<""<<":";
cin>>over;
cout<<endl;
cout<<"Bowler count:";
bowler=over*6;
cout<<bowler<<endl;
cout<<endl<<"How many maiden overs of bowlers"<<""<<"No"<<i<<""<<":";
cin>>maiden;
cout<<endl;
cout<<endl<<"How many out of bowlers"<<""<<"No"<<i<<""<<":";
cin>>out;
cout<<endl;
cout<<endl<<"How many score bowlers"<<""<<"No"<<i<<""<<":";
cin>>runs;
cout<<"Bowlers Name"<<" "<<"||"<<"Overs"<< " "<<"||"<<"Balls"<<"
"<<"||"<<"Maiden"<<" "<<"||"<<"Runs"<<"/"<<"Out"<<endl;
cout<<name<<" "<<"||"<<over<< " "<<"||"<<bowler<<" "<<"||"<<"Maiden"<<"
"<<"||"<<"Runs"<<"/"<<"Out"<<endl;
}
cout<<endl<<endl<<endl;
{
int sheet;
cout<<"Do you want to see score sheet so click the button 1"<<endl;
cin>>sheet;
if(sheet==1)
{
cout<<"______________________________________________"<<endl;
cout<<"|"<<"Competition"<<" "<<"||"<<"Venue"<<venue<<"
"<<endl;cout<<"______________________________________________"<<endl;
cout<<"______________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Match Between:"<<" "<<"||"<<"Versus :"<<teams<<"
"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Toss won by:"<<" "<<"||"<<"Elected to :"<<won<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Inning of:1"<<" "<<"||"<<"Date :"<<date<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"|"<<"Batting side"<<" "<<"||"<<won<<" "<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"How many batsman :";
cin>>dan;
cout<<endl<<"Name of batsman:"<<i<<":";
cin>>namepl;
cout<<endl;
cout<<"One run:";
cin>>one;
cout<<endl;
cout<<"Two run:";
cin>>two;
cout<<endl<<"How many batsman hit fours :";
cin>>four;
cout<<endl;
cout<<endl<<"How many batsman hit sixes :";
cin>>six;
cout<<endl;
cout<<endl<<"Total runs to batsman: ";
run=(one+two+four+six);
cout<<run;
cout<<endl;
cout<<"______________________________________________"<<endl;
cout<<"Batsman name"<<" "<<"||"<<"-1s"<<" "<<"||"<<"-2s"<<" "<<"||"<<"-
4s"<<" "<<"|"<<"-6s"<<" "<<"||"<<"Total runs"<<endl;
cout<<"______________________________________________"<<endl;
cout<<"namepl"<<" "<<"||"<<"one"<<" "<<"||"<<"two"<<" "<<"||"<<"four"<<"
"<<"||"<<"six"<<" "<<"||"<<"run"<<endl;
cout<<"______________________________________________"<<endl;
cout<<""<<"Bowling side "<<"||"<<lose <<""<<endl;
cout<<"______________________________________________"<<endl;
for(int i=1;i<=bowl;i++)
cout<<name<<" "<<"||"<<over<< " "<<"||"<<bowler<<" "<<"||"<<"Maiden"<<"
"<<"||"<<"Runs"<<"/"<<"Out"<<endl;
}
else
{
cout<<"OK THANKS!"<<endl;
}
}
}
}

You might also like