Monday, February 21, 2011

Assignment # 4

Create a class Team with following attributes:
string TeamName
player [] players;
static int players;
int Win
int Lose
int Draw

1.       Create a constructor that accepts an array of Players, team Name.
2.       Create a constructor that takes all attributes a parameters except player array.
3.       Create a method to add player in team addPlayer(Player objPlayer)
4.        Create a method to remove a player from team if it already added in array of players removePlayer(Player objPlayer)
5.       Create a method to display team summary displayTeamSummary()
6.       Create a program and demonstrate your constrictors and methods

3 comments:

  1. Assalam o Alikum Sir !

    In 3rd Line " player[]players " ye kia show kar raha ha ??

    What means that Line ??

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. @Syed Sami Ur Rehman:

    It creates an array of objects of class player, please note that, in my questions I try to avoid code samples, so you need to read arrays from your book first, then use correct syntax.

    ReplyDelete