Results 1 to 3 of 3
  1. #1
    yannick_bba is offline Member
    Join Date
    Apr 2011
    Rep Power

    Question Football Roster coursework help needed!

    I need some help tackling an exercise I have to complete. I have tried several ways, below are the specifications of the assignment, I would like to know how you would tackle this.

    Hope you can help.

    A local football club wishes to store information on its current squad of players:

    Each Player’s personal information (first name, last name, age, height and weight) should be recorder in a class Person. Each Player’s record for the season should be stored in a class Player. The information stored for each player consists of the number of games played and goals scored. Write a class Goalkeeper which in addition records the number of penalties that the goalkeeper has saved. Provide appropriate methods for accessing this information. You should make appropriate use of inheritance in your solution.

    Information on all Players should be stored in a class Club. Club stores the name of the club and maintains information about all of it's players. Club has methods to add and remove Players addPlayer(Player p) and removePlayer(Player p). It should also contain a method to retrieve a Player’s details given her/his first and last names. (You may assume that no two Players have identical first and last names).

    Write classes Person, Player, Goalkeeper and Club that satisfy the above specification. Write a class Test that contains a main method that tests your implementations and prints out the information held about each player in the club. When a new player is signed, she/he should be inserted into the Club class in alphabetical order of last name (and first name if last names are the same). To do this make your Person and Player class implement the appropriate Comparable interface.

    Write a class ComparePlayers that implements the Comparator<Player> interface. It should compare players by number of games played (and then by alphabetical order of surname if the number of games played is the same). Implement a new Constructor for the Club class that takes a Comparator<Player> parameter. Hence write a main program that will print information about each player in the club where players are listed by decreasing order of games played. This should allow ordering to be dictated by the main program without modifying the code in any of your other classes.


    The main problem for me at the moment, is making a sort of list that holds data of the players. First name, last name, age, height, and weight. I tried 5 arrays which worked, until they asked me to sort the players according to last name and goals scored. How can I make a list, that in one block, or one element, holds all the information of ONE player?

    Please help me! :D

  2. #2
    randoms:) is offline Member
    Join Date
    Apr 2011
    Rep Power


    Last edited by randoms:); 05-12-2011 at 10:16 PM.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Football League Table - Idea's?
    By RSYR in forum New To Java
    Replies: 2
    Last Post: 11-24-2010, 06:46 PM
  2. A football game in java
    By receme in forum Java Gaming
    Replies: 2
    Last Post: 09-01-2010, 03:49 PM
  3. football league
    By university in forum New To Java
    Replies: 2
    Last Post: 11-06-2008, 05:14 AM
  4. Help Java Coursework Help!!!!
    By miahj in forum New To Java
    Replies: 2
    Last Post: 11-29-2007, 04:37 AM
  5. Someone please help with my coursework....
    By in forum Eclipse
    Replies: 1
    Last Post: 08-09-2007, 07:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts