2D array opgave
Har den her rapport jeg skal lave færdig til i morgen, og har prøvet at lave det her 2D array tusind gange på jeg ved ikke hvor mange forskellige måder, men kan slet ikke få det til at virke :(Nogen der kan fortælle mig hvordan jeg skal gøre det?
Opgaven beskrivelsen lyder sådan her:
5. Pair, forming a team of two players (20 points)
A bridge pair is basically two players. One pair plays with another based on a protocol where points equal to the value of the cards allow the pair to communicate with each other without showing the cards to anyone.
Write a class Pair where the information on pairs is kept in a small two element array.
The Pair class must have the following elements
5.1. Data fields ( 2 points )
5.1.1. String name; // The name of the pair
5.1.2. Player[] players; // The players
5.2. Constructor ( 3 points )
5.2.1. Pairs(String name, Player p1, Player p2)
 Initializes the data fields including the two element array.
5.3. Methods
5.3.1. int getPairPoints() ( 2 points )
 A sum of the two players individual points
5.3.2. void changePlayer(Player p1, int index) ( 2 points )
 index is the position the new player is inserted in
5.3.3. String toString() ( 1 point )
 return the pair name of both players
Write a test class that
5.4. creates at least one Pair object ( 3 points )
5.5. uses all the methods and uses System.out.println(…) to show the results of the methods calls on the screen. ( 7 points )
