944,016 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1184
  • C RSS
Mar 7th, 2007
0

Basketball League Project

Expand Post »
I am coding a class project where I will have a basketball league. The league will include 3 divisions and each division will have 5 teams. Each team will have a number of players and one coach. I must have 5 seperate classes. I already have two classes called person and player and will also add coach. I think my next two classes will be division and team. My question is how should I implement these two classes? I must be able to add players and a coach to a team and add teams to a division. Should I use arrays for only 3 divisions and for the teams? I'm just a little confused on how to set everything up and how everything will interact.
Similar Threads
Reputation Points: 41
Solved Threads: 0
Junior Poster in Training
SHWOO is offline Offline
73 posts
since Jul 2006
Mar 7th, 2007
0

Re: Basketball League Project

Click to Expand / Collapse  Quote originally posted by SHWOO ...
I am coding a class project where I will have a basketball league. The league will include 3 divisions and each division will have 5 teams. Each team will have a number of players and one coach. I must have 5 seperate classes. I already have two classes called person and player and will also add coach. I think my next two classes will be division and team. My question is how should I implement these two classes? I must be able to add players and a coach to a team and add teams to a division. Should I use arrays for only 3 divisions and for the teams? I'm just a little confused on how to set everything up and how everything will interact.
I'll provide a ascii diagram of how you might implement this and a following explaination:
  1. [ class_league ]
  2. [ class_division ] [ class_team ] [ class_player ]
  3. | | | |___________ |
  4. | | |_[ class_division1 ] | | |___[ class_player1
  5. | |_____[ class_division2 ] | | |___[ class_player2
  6. |_________[ class_division3 ] | | |___[ class_player3
  7. [ class_team1 ]______________| .... player up to 5
  8. [ class_team2 ]______________|
  9. [ class_team3 ]______________|
  10. .... team division up to 5

There will be one class league.
There will be a base class, perhaps an ADT (i.e. pure virtual) class division and inhereted class divisionN where N is the sucessive number up to the number of divisions you desire.
There will be a base class team, also maybe ADT, team and inherited teams.
There will be a base class player and follows the same as the above description of base classes.

The point is, is classes have commonalities, these commonalities (i.e. functions and/or rules) will be implemented or specified for the base classes of the inherited classes. You'll have to figure the distinctions for each inherited class and their commonalities. Just some ideas.

Good luck, LamaBot
Last edited by WaltP; Mar 7th, 2007 at 2:41 am. Reason: Added CODE tags to preserve formatting -- did you look at your post with the PREVIEW button?
Reputation Points: 11
Solved Threads: 13
Junior Poster
Lazaro Claiborn is offline Offline
171 posts
since Jan 2007
Mar 7th, 2007
0

Re: Basketball League Project

Referring to my previous post reply, I'll give an example of the distinctions and commonalites. Each team could have uniforms. The uniforms for each team have a basic structure yet have a different logo design. The basic structure might be specified in the base class of the team or just have a base class for the uniform. Each teams logo would be used in the inherited class which inherit the basic structure of the uniform but add some unique logo specific for that team.

Good luck, LamaBot
Last edited by Lazaro Claiborn; Mar 7th, 2007 at 2:37 am.
Reputation Points: 11
Solved Threads: 13
Junior Poster
Lazaro Claiborn is offline Offline
171 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Uncompress
Next Thread in C Forum Timeline: plss help me with my case study......





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC