1/8
Flashcards about the Coin Collection Tool Class to test a student's knowledge.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the purpose of the CoinCollectionTools class?
To assist the Coin Club in organizing and maintaining their coin collection.
What does the CoinCollectionTools constructor do?
It instantiates the coinBox (a 2D array of Coin objects) and fills it with default Coin objects.
What are the parameters of the CoinCollectionTools constructor?
country (String), rows (int), and columns (int).
What precondition must myCoins
satisfy for the fillCoinBox
method?
myCoins
is in order by year and the size of myCoins
is not greater than the total number of compartments available.
What is the return value of the fillCoinBox
method?
The completed two-dimensional array of Coin
objects, coinBox
.
What is column-major order?
Filling the 2D array, coinBox, moving down the columns in order until all coin objects have been placed in a compartment.
What are the preconditions for the fillCoinTypeList
method?
all cells in coinBox contain a valid Coin object and coinBox is ordered by year in column-major order followed by default Coin objects.
What is the postcondition for fillCoinTypeList
method?
Coins in ArrayList are in order grouped by coinType
What should fillCoinTypeList
return?
ArrayList of Coin objects