Happy New Year!!
Welcome back!
Classwork:
“Abstract Classes” already posted.
Students presentation/discussions about the following assignments:
1. Create a class DataSet of BankAccounts. The constructor creates an ArrayList. Write the test class to add, delete and print bank accounts.
2. Create a class Purse that contains an ArrayList of Coin(s). Write the test class to add, delete, and print coins.
Modify the Purse class to be implemented with ArrayList class and to use a for-each loop.
Implement the following methods in the Purse class:
/** Counts the number of coins in the purse @return the number of coins */ public int count() { } /** Tests if the purse has a coin that matches a given coin. @param aCoin the coin to match @return true if there is a coin equal to aCoin */ public boolean find(Coin aCoin) { } /** Counts the number of coins in the purse that match a given coin. @param aCoin the coin to match @return the number of coins equal to aCoin */ public int count(Coin aCoin) { } /** Finds the coin with the largest value. (Precondition: The purse is not empty) @return a coin with maximum value in this purse */ Coin getMaximum() { }
Homework:
Self-review questions 7.1 through 7.8
1 Question on edmodo.com