Professional Documents
Culture Documents
Final Assi
Final Assi
void getshirtno() {
cout << "Enter the shirt no of the player:" << endl;
cin >> sn;
}
void gettotalruns() {
while (1) {
cout << "Enter the total runs of the player:" << endl;
cin >> tr;
if (tr <= 4000) {
break;
}
else {
cout << "ERROR:" << endl;
continue;
}
}
}
void gettotalseason() {
while (1) {
cout << "Enter the total season of the player:" << endl;
cin >> tr;
if (ts <=10) {
break;
}
else {
cout << "ERROR:" << endl;
continue;
}
}
}
void getdeliveryfaced() {
while (1) {
cout << "Enter the delivery faced of the player:" << endl;
cin >> df;
if (df <=60) {
break;
}
else {
cout << "ERROR:" << endl;
continue;
}
}
}
void average(int average) {
average = (tr / ts);
cout << "The average of player is :" << average;
}
};
int main() {
int sn{};
int tr{};
int ts{};
int df{};
int average{};
Player p1{sn,tr,ts,df};
p1.getshirtno();
p1.gettotalruns();
p1.gettotalseason();
p1.getdeliveryfaced();
cout << "The detail of the player 2 is:" << endl;
Player p2{ sn,tr,ts,df };
p2.getshirtno();
p2.gettotalruns();
p2.gettotalseason();
p2.getdeliveryfaced();
Player p3{ sn,tr,ts,df };
p3.getshirtno();
p3.gettotalruns();
p3.gettotalseason();
p3.getdeliveryfaced();