Create a Cricket or Sports Management Calculator Program in C++ programming language
#include<conio.h>
#include<iostream.h>
class driver
{
double ts,age,tmp,cen,fif;
char *name;
float average;
public:
driver();
~driver();
void getdata();
void friend putdata(driver);
};
driver::driver()
{
}
driver::~driver()
{
}
void driver::getdata()
{
cout<<"\n\tEnter Player Name :-\t";cin>>name;
cout<<"\n\tEnter Player Age :-\t";cin>>age;
cout<<"\n\tEnter Total Score :-\t";cin>>ts;
cout<<"\n\tEnter Total Match Played :-\t";cin>>tmp;
cout<<"\n\tEnter Total Centuries :-\t";cin>>cen;
cout<<"\n\tEnter Total Fifties :-\t";cin>>fif;
average=ts/tmp;
}
void putdata(driver m)
{
cout<<"\n\tPlayer Name :-\t"<<m.name;
cout<<"\n\n\tPlayer Age :-\t"<<m.age;
cout<<"\n\n\tTotal Score :-\t"<<m.ts;
cout<<"\n\n\tAverage Run :-\t"<<m.average;
cout<<"\n\n\tTotal Match Played :-\t"<<m.tmp;
cout<<"\n\n\tTotal Centuries :-\t"<<m.cen;
cout<<"\n\n\tTotal Fifties :-\t"<<m.fif;
}
void main()
{
textcolor(111);
clrscr();
driver p;
p.getdata();
putdata(p);
getch();
}
#include<iostream.h>
class driver
{
double ts,age,tmp,cen,fif;
char *name;
float average;
public:
driver();
~driver();
void getdata();
void friend putdata(driver);
};
driver::driver()
{
}
driver::~driver()
{
}
void driver::getdata()
{
cout<<"\n\tEnter Player Name :-\t";cin>>name;
cout<<"\n\tEnter Player Age :-\t";cin>>age;
cout<<"\n\tEnter Total Score :-\t";cin>>ts;
cout<<"\n\tEnter Total Match Played :-\t";cin>>tmp;
cout<<"\n\tEnter Total Centuries :-\t";cin>>cen;
cout<<"\n\tEnter Total Fifties :-\t";cin>>fif;
average=ts/tmp;
}
void putdata(driver m)
{
cout<<"\n\tPlayer Name :-\t"<<m.name;
cout<<"\n\n\tPlayer Age :-\t"<<m.age;
cout<<"\n\n\tTotal Score :-\t"<<m.ts;
cout<<"\n\n\tAverage Run :-\t"<<m.average;
cout<<"\n\n\tTotal Match Played :-\t"<<m.tmp;
cout<<"\n\n\tTotal Centuries :-\t"<<m.cen;
cout<<"\n\n\tTotal Fifties :-\t"<<m.fif;
}
void main()
{
textcolor(111);
clrscr();
driver p;
p.getdata();
putdata(p);
getch();
}
Create a Cricket or Sports Management Calculator Program in C++ programming language
Reviewed by Unknown
on
6:14:00 PM
Rating:
No comments: