mardi 10 mars 2015

he class contain methods that i need to implement in order to run the class, the comment on each method tell what that method should do



public class ChairsSet { // The set of chairs


private boolean Occupied[ ];


private boolean Valid[ ];


private int Count;


private int OccupiedChairs = 0;


private int ValidChairs = 0;


public ChairsSet(int numberOfChairs)


{ // Constructor



//this.name = "aKid";


}//end constructor


public synchronized void removeChair( ) {


}//removeChair


public synchronized int takeASeat( )


{ // Player sits down


}//takeASeat


public synchronized void getOutOfSeat(int seat)


{ // Player leaves chair



}


public synchronized int validChairs( )


{ // How many chairs left?


} public synchronized int occupiedChairs( )


{ // How many chairs are in use?


} public synchronized boolean allSeated( )


{ // All chairs occupied?


}


}//ChairSet




Aucun commentaire:

Enregistrer un commentaire