Basketball League Project

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2006
Posts: 73
Reputation: SHWOO is an unknown quantity at this point 
Solved Threads: 0
SHWOO SHWOO is offline Offline
Junior Poster in Training

Basketball League Project

 
0
  #1
Mar 7th, 2007
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.
Climbing the learning curve of C++
Becoming an expert seems light years away!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 171
Reputation: Lazaro Claiborn is an unknown quantity at this point 
Solved Threads: 13
Lazaro Claiborn's Avatar
Lazaro Claiborn Lazaro Claiborn is offline Offline
Junior Poster

Re: Basketball League Project

 
0
  #2
Mar 7th, 2007
Originally Posted by SHWOO View 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.
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?
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 171
Reputation: Lazaro Claiborn is an unknown quantity at this point 
Solved Threads: 13
Lazaro Claiborn's Avatar
Lazaro Claiborn Lazaro Claiborn is offline Offline
Junior Poster

Re: Basketball League Project

 
0
  #3
Mar 7th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 959 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC