classes: Player, Batsman and Bowler, where Player should be base class and Batsman and Bowler should be its derived classes

concept of Polymorphism to generate the sample output

Use following formulas to calculate Batting and Bowling average of batsman and bowler, where Total Innings and Total Overs should be non-zero.

Batting Average = Runs Scored / Total Innings
Bowling Average = Total number of runs conceded / Total Overs
Can u share complete code? Plz
Roughly, as a start you could have, just as your heading states :

Player class, name as member, virtual method average(int, int)

Bowler class inheriting from Player - members no-runs, no_innings - average(??) method based on these two members

Batsman (Batsperson?) class inheriting from Player with blah blah - average(??) etc
Topic archived. No new replies allowed.