There is a Ground class that keeps the ground name and city. There is another class Game, that holds information on game names and the date of the game on which the game will be played. The Player class keeps the information about a Player, name, and code. There is a Team class that holds the team name and the total number of players counted.
In a cricket game, a team can have 11 players including 1 captain. The Game will be played between 2 teams on the ground. No player can play the game without a team on the ground. And no game can be played without a ground’s information.
Design it using any possible type of Inheritance. Input information for a game of 2 teams, and display the following:
Ground name City Game Team1 Team2 Captain1 Captain2.
Comments
Leave a comment