-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbowling.h
158 lines (138 loc) · 4.21 KB
/
bowling.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#include<iostream>
#include<iomanip>
using namespace std;
class bowling
{
public:
virtual void getdata()=0;
virtual void disp()=0;
virtual int getavg()=0;
};
class bo_test:public bowling
{
private:
int *matchPlayed,*balls;
int *Runs_C,*Wic;
float *avg;
int *Fi,*Ten;
public:
bo_test():matchPlayed(new int (000)),balls(new int (000)),Runs_C(new int (000)),Wic(new int (000)),avg(new float (000)),Fi(new int(00)),Ten(new int (000)){}
bo_test(int f,int g,int h,int i,float j,int k,int l):matchPlayed(new int (f)),balls(new int (g)),Runs_C(new int (h)),Wic(new int (i)),avg(new float (j)),Fi(new int(k)),Ten(new int (l)){}
void getdata()
{
cout<<"\nBOWLING: ";
cout<<"\nTEST";
cout<<"\nInnings: ";
cin>>*matchPlayed;
cout<<"Balls ";
cin>>*balls;
cout<<"Runs Conceeded : ";
cin>>*Runs_C;
cout<<"Wickets: ";
cin>>*Wic;
cout<<"5 Wickets: ";
cin>>*Fi;
cout<<"10 Wickets: ";
cin>>*Ten;
if(*Runs_C==0 || *Wic==0)
{
*avg=0;
}
else{*avg=*Runs_C/(*Wic);}
}
void disp()
{
cout<<"\n"<<setw(130)<<setfill('-')<<"\n\t\t\t\t\tBOWLING CARRER SUMMARY\n"<<setw(100)<<setfill('-')<<"\n";
cout<<setfill(' ');
cout<<" "<<setw(15)<<" Matches"<<setw(15)<<"BALLS"<<setw(15)<<"RUNS_CON"<<setw(15)<<"AVG"<<setw(15)<<"5W"<<setw(15);
cout<<setw(15)<<"10W"<<"\n";
cout<<"TEST: "<<setw(15)<<*matchPlayed<<setw(15)<<*balls<<setw(15)<<*Runs_C<<setw(15)<<*avg<<setw(15)<<*Fi<<setw(15);
cout<<setw(15)<<*Ten<<"\n"<<endl;
}
int getavg()
{
return *avg;
}
};
class bo_odi:public bowling
{
private:
int *matchPlayed,*balls;
int *Runs_C,*Wic;
float *avg;
int *Fi,*Ten;
public:
bo_odi():matchPlayed(new int (000)),balls(new int (000)),Runs_C(new int (00000)),Wic(new int (000)),avg(new float (000)),Fi(new int(00)),Ten(new int (000)){}
bo_odi(int f,int g,int h,int i,float j,int k,int l):matchPlayed(new int (f)),balls(new int (g)),Runs_C(new int (h)),Wic(new int (i)),avg(new float (j)),Fi(new int(k)),Ten(new int (l)){}
void getdata()
{
cout<<"\nODI";
cout<<"\nInnings: ";
cin>>*matchPlayed;
cout<<"Balls ";
cin>>*balls;
cout<<"Runs Conceeded : ";
cin>>*Runs_C;
cout<<"Wickets: ";
cin>>*Wic;
cout<<"5 Wickets: ";
cin>>*Fi;
cout<<"10 Wickets: ";
cin>>*Ten;
if(*Runs_C==0 || *Wic==0)
{
*avg=0;
}
else{*avg=*Runs_C/(*Wic);}
}
void disp()
{
cout<<"ODI :"<<setw(15)<<*matchPlayed<<setw(15)<<*balls<<setw(15)<<*Runs_C<<setw(15)<<*avg<<setw(15)<<*Fi<<setw(15);
cout<<setw(15)<<*Ten<<"\n"<<endl;
}
int getavg()
{
return *avg;
}
};
class bo_t20:public bowling
{
private:
int *matchPlayed,*balls;
int *Runs_C,*Wic;
float *avg;
int *Fi,*Ten;
public:
bo_t20():matchPlayed(new int (000)),balls(new int (000)),Runs_C(new int (00000)),Wic(new int (000)),avg(new float (000)),Fi(new int(00)),Ten(new int (000)){}
bo_t20(int f,int g,int h,int i,float j,int k,int l):matchPlayed(new int (f)),balls(new int (g)),Runs_C(new int (h)),Wic(new int (i)),avg(new float (j)),Fi(new int(k)),Ten(new int (l)){}
void getdata()
{
cout<<"\nT20";
cout<<"\nInnings: ";
cin>>*matchPlayed;
cout<<"Balls ";
cin>>*balls;
cout<<"Runs Conceeded : ";
cin>>*Runs_C;
cout<<"Wickets: ";
cin>>*Wic;
cout<<"5 Wickets: ";
cin>>*Fi;
cout<<"10 Wickets: ";
cin>>*Ten;
if(*Runs_C==0 || *Wic==0)
{
*avg=0;
}
else{*avg=*Runs_C/(*Wic);}
}
void disp()
{
cout<<"T20 :"<<setw(15)<<*matchPlayed<<setw(15)<<*balls<<setw(15)<<*Runs_C<<setw(15)<<*avg<<setw(15)<<*Fi<<setw(15);
cout<<setw(15)<<*Ten<<"\n"<<endl;
}
int getavg()
{
return *avg;
}
};