Page 507 - AP Computer Science A, 7th edition
P. 507
(A) Replace Line 3 with
for (int k = NUMCARDS; k >= 0; k--)
(B) Replace Line 3 with
for (int k = NUMCARDS – 1; k > 0; k--)
(C) Replace Line 3 with
for (int k = 1; k <= NUMCARDS; k++)
(D) Replace Line 5 with
int randPos = (int) (Math.random() ∗ k); (E) Replace Lines 7 – 9 with
Card temp = cards[randPos]; cards[randPos] = cards[k]; cards[k] = temp;
8. A programmer wants to simulate several different but related solitaire games, each of which uses a standard 52-card deck. Each game starts with 10 cards dealt face up on a table. The game types differ in the rules that allow groups of cards to be discarded from the table and new cards to be dealt from the remainder of the deck. For each of the solitaire games, a winning game occurs if there are no cards left in the pile or on the table. To represent the table for the games, the programmer will use the inheritance relationship shown below.
Which of the following methods should be abstract in the Table class?