Elevens Lab Questions Essay

Submitted By xslash3dx
Words: 308
Pages: 2

Activity 7
1. A deck of 52 cards. A playing board ( 3x3 ). Knowledge of point values and their respective cards. Private Variables: Cards on board, Deck (cards left ), point values, suits, ranks.
2. Game Starts. Deck deals 9 cards onto the board. Play then selects cards to remove. Cards selected are checked for validity. Cards are removed. Checks if all cards are removed. If so, game is won, if not, checks if there are any other plays. If there are no other plays, it is game over. If there is, game continues. Cards are dealt to locations with no cards.
3. Yes, but there are some methods that are not yet coded.
4. A) After shuffle method is called in newGame method.
B) The islegal method and anotherplaypossible method.
C) 0 1 null 3 null null 6 7 null
D) for ( int k = 0; k < selected.length(); k++){ System.out.print ( selected[k] + “ “ )
E) Anotherplaypossible because cardIndexes checks if there are any card left relatively speaking, and determines if the game is won at that point or not.

Activity 8
1. Elevens, Thirteens, and Tens are all a type of board and both use card and deck instance variables. The difference between these game types are the implementation of the isLegal and anotherPlayIsPossible methods.
2. Abstract methods and constructor
3. isLegal method, anotherPlayIsPossible method, and constructor. The methods do not cover all the differences becauseQ are not implemented in ElevensBoard yet. The constructor however, calls