Objective: Your goal is get your jeroo onto the right side of the island. Note that the red areas are nets. You must toss() a flower onto the net before you can go on the net.. You will need the following island file .

Objective: Your goal is get your jeroo onto the right side of the island. Note that the red areas are nets. You must toss() a flower onto the net before you can go on the net.. You will need the following island file .

Monsoon rains have created a lake in the middle of Santong Island. Furthermore, that lake contains an island. Two Jeroos were separated by the rains. One is on the main part of Santong Island, but the other is on the island in the middle of the lake. The goal of this program is to have each Jeroo explore the shoreline of the lake.
Download Walk the Lake (This has several maps, choose any 1)
Acknowledgement
This problem is adapted from one that was created originally by Erica Eddy of The University of Wisconsin – Parkside.
Or you can try walk the lake using loops using this map and Jeroo assignment
Do you ever wish that you could make your Jeroo turn around 180 degrees?
Example 2 of a Custom Method to “Go Around a net”
You can download the files for the animation below here
Objective: Three Jeroos (you give them names) are practicing for the Santong Relays. Figure 5 shows the course at the start of the race. The first Jeroo begins at (4,9) facing EAST. It must pick the flower and give it to the second Jeroo who begins at (7,13) facing NORTH. The second gives the flower to the third Jeroo who begins at (4,15) facing WEST. The third Jeroo must plant the flower at (3,16), run to (3,21) and stop

Objective:

Objective: Your goal is to have a jeroo beautify the Island. Instantiate a jeroo with 8 flowers in its pouch and have the jeroo plant the flowers in the pattern below Download these beginning-activites
![]() |
![]() |
![]() |
You have a lot of flexibility in creating this class, but here is what it should be able to do
It’s up to you to decide how to implement the functionality below. You will only lose credit if your methods clearly make no sense, have bad variable names/method names.
The functionality above ^^ can be implemented in any efficient way that makes sense, but it must be implemented. I am leaving that part up to you!
I. Copy and paste this code below in the Jeroo “IDE”. Run the code several times unti you understand what is going on, then try experimenting with the code, changing it around until you are comfortable with the basic methods of a Jeroo.
II.
Objective: Have a Jeroo spell out the lettter “Z ” in the same fashion as Part I
Picture of the finished project
III.
Objective: Have a Jeroo spell out the letter “O ” in the same fashion as Part I
This is the first part of a 2 part project.
Constructor
instance Variables
Methods

Static Variable(s)
instance Variables
Constructor
Methods
SavingsAccount extends Account
- instance variables
- private double interestRate // //@ assumes that interest rate is not in decimal format i.e. 1.7 not .017
- private ArrayList<Double> dailyBalances
static variables
- public static final int MINIMUM_BALANCE=100; // this is the absolute minimum amount of money that must always be in the account
- methods
- public boolean withdraw(double amount) //@override the withdraw() method to ensure that currentBalance the never gets below MINIMUM_BALANCE
- public void updateInterestRate(double newRate) //updates the interestRate
- public void recordDailyBalance() // @ record current day’s balance by storing current balance in dailyBalances .
- public ArrayList<Double> getDailyBalances() // @ return dailyBalances .
- public double projectBalance(double timeInYears) // use the compound interest formula . Assume that the bank compounds the balance monthly. To learn more about how compound interest really works, click here .
- You will need to convert interest rate from something like 1.7%, as an example , to 0.017
- public void updateInterestPayment() // @ once a month update account based on average daily balances and interest rate.
*calculate the average monthly balance
* multiply balance by the interest rate (remember this must be converted to decimal)
* add that interest back onto the balance
instance Variables
Methods
Tester file :
[pastacode lang=”java” manual=”import%20java.util.ArrayList%3B%0A%0Apublic%20class%20Tester%20%7B%20%0A%20%20%20%20boolean%20verbose%20%3D%20false%3B%20%2F%2Fset%20to%20true%20for%20some%20expanded%20occasional%20error%20messages%0A%0A%0A%20%20%20%20public%20Tester()%20%7B%0A%20%20%20%20%20%20%20%20p2(%22Begin%20Testing%22)%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20p2(%22Version%204%22)%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20p2(%22set%20variable%20verbose%20to%20true%20if%20you%20want%20some%20occasional%20extra%20tips%20on%20errors%22)%3B%20%20%20%20%0A%09%09p2(%22********************************************************************%22)%20%3B%0A%09%09p2(%22********************************************************************%22)%20%3B%0A%20%20%20%20%20%20%20%20doTest()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20public%20void%20doTest()%7B%0A%0A%20%20%20%20%20%20%20%20int%20correct%20%3D%200%3B%0A%20%20%20%20%20%20%20%20int%20wrong%20%3D%200%3B%0A%20%20%20%20%20%20%20%20Person%20tyler%20%3D%20new%20Person(%22tyler%22%2C%2018)%3B%0A%20%20%20%20%20%20%20%20Person%20joe%20%3D%20new%20Person(%22joe%22%2C%2018)%3B%0A%20%20%20%20%20%20%20%20Person%20jim%20%3D%20new%20Person(%22jim%22%2C%2017)%3B%0A%0A%20%20%20%20%20%20%20%20if(tyler.compareTo(joe)%20%3D%3D%200)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%40person%2C%20compareTo()%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if(jim.compareTo(joe)%20%3D%3D%20-1)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%40person%2C%20compareTo()%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if(joe.compareTo(jim)%20%3D%3D%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%40person%2C%20compareTo()%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if(%20joe.getName().equals(%22joe%22))%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%40person%2C%20getName()%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%0A%20%20%20%20%20%20%20%20CertificateOfDeposit%20a%20%3D%20new%20CertificateOfDeposit(tyler%2C%20120)%3B%0A%20%20%20%20%20%20%20%20double%20a_original_bal%20%3D%20a.getCurrentBalance()%3B%0A%20%20%20%20%20%20%20%20a.addOwner(joe)%3B%0A%20%20%20%20%20%20%20%20int%20a_num1%20%3D%20a.getAccountNumber()%20%3B%20%20%20%20%0A%09%09%0A%09%09%0A%0A%20%20%20%20%20%20%20%20if%20(a_num1%20!%3D%201%20)%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%20%20%20%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22First%20account%20’s%20id%20should%20be%20’1’%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20CertificateOfDeposit%20a2%20%3D%20new%20CertificateOfDeposit(jim%2C%20120)%3B%0A%0A%0A%0A%0A%20%20%20%20if(a2.getAccountNumber()%20%3C%3D%20a_num1)%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%20%20%20%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22Unique%20account%20numbers%20not%20working%20correctly%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%0A%20%20%20%20%20%20%20%20if%20(a.getOwners().size()%20!%3D%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22addOwner()%20not%20working%20%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%20%20%20%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%20%20%20%20%20%20%20%20a.remove(joe)%3B%0A%20%20%20%20%20%20%20%20if%20(a.getOwners().size()%20!%3D%201)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%20%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%2C%20probably%20removeOwner()%20not%20working%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Person%20owner%20%3D%20a.getOwners().get(0)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if(owner.getName().toLowerCase().equals(%22tyler%22))%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%20%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%2C%20probably%20removeOwner()%20not%20working%20%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%20%20%20%20%20%20%20%20if(Math.abs(a_original_bal%20-%20120)%20%3E%200.000001)%0A%09%09%7B%0A%09%09p2%20(%22foo%20problem%20with%20setting%20%20balance%22)%3B%0A%09%09wrong%2B%2B%3B%0A%09%09%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20a.deposit(25)%3B%0A%20%20%20%20%20%20%20%20if(Math.abs(a.getCurrentBalance()%20-%20145)%20%3E%200.000001)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%20%20%20%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22problem%20with%20setting%20%20balance%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Person%20rob%20%3D%20new%20Person(%22rob%22%2C%2018)%3B%0A%20%20%20%20%20%20%20%20CheckingAccount%20b%20%3D%20new%20CheckingAccount(rob%2C%20200)%3B%0A%20%20%20%20%20%20%20%20b.deposit(500)%3B%0A%20%20%20%20%20%20%20%20b.withdraw(450)%3B%0A%20%20%20%20%20%20%20%20if(%20b.equals(a))%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22Failed%20equals()%20test%20(Many%20things%20could%20cause%20this)%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%20%20%20%20%20%20%20%20if(%20a.equals(a)%20%3D%3D%20false)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22Failed%20equals()%20test%20(Many%20things%20could%20cause%20this)%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%0A%20%20%20%20%20%20%20%20double%20balanceNow%20%3D%20b.getCurrentBalance()%3B%0A%20%20%20%20%20%20%20%20int%20checkNum%20%3D%20b.writeCheck(4)%3B%0A%20%20%20%20%20%20%20%20%2F%2F%20p2(%22checkNum%20%3A%20%22%20%2B%20checkNum)%3B%0A%20%20%20%20%20%20%20%20%20%20%20if(checkNum%20%3E%3D%20100)%20%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%2C%20Check%20Numbers%20cannot%20be%20lower%20than%20100%22)%20%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20int%20check2Num%20%3D%20b.writeCheck(4)%3B%0A%20%20%20%20%20%20%20%20if(check2Num%20-%20checkNum%20%3D%3D%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20involving%20checknumbers.%20Should%20increment%20by%201%22)%20%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20if(%20balanceNow%20-%20b.getCurrentBalance()%20%3D%3D%20%208)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22Error%20involving%20writing%20checks%20and%20balance…could%20be%20various%20problems%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%20most%20likely%20your%20writeCheck()%20or%20withdraw()%20are%20the%20problem%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20balanceNow%20%3D%20b.getCurrentBalance()%20%3B%0A%20%20%20%20%20%20%20%20int%20check3Num%20%3D%20b.writeCheck(242.1)%3B%0A%0A%20%20%20%20%20%20%20%20if(check3Num%20-%20checkNum%20%3D%3D%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20involving%20checknumbers.%20Should%20increment%20by%201%2Ceven%20if%20the%20check%20bounces!%22)%20%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20if(balanceNow%20%20%3D%3D%20b.getCurrentBalance())%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22Error%20involving%20bounced%20checks.%20You%20cannot%20withdrawal%20more%20than%20your%20current%20balance%22)%20%3B%0A%20%20%20%20%20%20%20%20p2(%22exiting%20testing%20program%22)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%20%20%20%20%20%20%20%20boolean%20badChkNum%20%3D%20%20b.cancelCheck(50)%3B%0A%20%20%20%20%20%20%20%20if(badChkNum%20%3D%3D%20false)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22Error.%20cancelCheck%20on%20non%20existent%20check.%20Should%20return%20false%2C%20but%20didn’t%22)%20%3B%0A%20%20%20%20%20%20%20%20p2(%22exiting%20testing%20program%22)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20int%20check4Num%20%3D%20b.writeCheck(100)%3B%0A%0A%0A%20%20%20%20%20%20%20%20b.cancelCheck(check4Num)%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20double%20balanceAferCancel%20%3D%20b.getCurrentBalance()%3B%0A%20%20%20%20%20%20%20%20if(%20balanceAferCancel%20%3D%3D%20242)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if(balanceAferCancel%20%3D%3D%20142)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22cancelCheck()%20did%20not%20update%20balance.%20You%20still%20have%20deducted%20the%20amount%20for%20the%20check%20that%20is%20now%20cancelled%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%20%2C%20could%20be%20various%20things%20but%20most%20likely%20relateing%20to%20cancelCheck()%2Fdeposit()%20%20%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20if(balanceNow%20%20%3D%3D%20b.getCurrentBalance())%0A%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20%2F%2F%20else%0A%20%20%20%20%20%20%20%20%2F%2F%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%2F%2F%20p2(%22Error%20involving%20bounced%20checks.%20You%20cannot%20withdrawal%20more%20than%20your%20current%20balance%22)%20%3B%0A%20%20%20%20%20%20%20%20%2F%2F%20%7D%0A%0A%0A%20%20%20%20%20%20%20%20Person%20roochi%20%3D%20new%20Person(%22roochi%22%2C%2012)%3B%0A%20%20%20%20%20%20%20%20SavingsAccount%20c%20%3D%20new%20SavingsAccount(roochi%2C%20110)%3B%0A%20%20%20%20%20%20%20%20boolean%20allGood%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20if(c.getCurrentBalance()%3D%3D%20110)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20allGood%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%2C%20could%20be%20constructor%20or%20getCurrentBalance()%22)%20%3B%0A%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%0A%0A%20%20%20%20%20%20%20%20c.withdraw(5)%3B%0A%20%20%20%20%20%20%20%20if(c.getCurrentBalance()%3D%3D%20105)%0A%20%20%20%20%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if(allGood%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%2C%20probably%20withdraw()%22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22error%2C%20could%20be%20constructor%20or%20getCurrentBalance()%20%22)%20%3B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20boolean%20isNull%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20try%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20c.addOwner(tyler)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20catch(%20NullPointerException%20e)%7B%0A%20%20%20%20%20%20%20%20isNull%20%3D%20true%3B%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20if(isNull)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20p2(%22Looks%20like%20owners%20arraylist%20is%20null%22)%3B%0A%20%20%20%20%20%20%20%20p2(%22exiting%20program%20now%2C%20fix%20nullpointer%20first%22)%3B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%0A%2F%2Fhere%20%0A%2F%2F%20public%20String%20toString()%0A%0A%0A%0A%0A%0A%20%20%20%20%20%20%20%20Person%20james%20%3D%20new%20Person(%22Jim%20Adams%20II%22%2C%2012)%3B%0A%20%20%20%20%20%20%20%20SavingsAccount%20jamesAcct%20%20%3D%20new%20SavingsAccount(james%20%2C%20666%20)%3B%0A%20%20%20%20%20%20%20%20jamesAcct.addOwner(new%20Person(%22Jane%20Adams%20%22%2C%2034)%20)%3B%0A%20%20%20%20%20%20%20%20jamesAcct.addOwner(new%20Person(%22Jim%20Adams%20Sr%22%2C%2035)%20)%3B%0A%20%20%20%20%20%20%20%20ArrayList%3CPerson%3E%20owners%20%3D%20jamesAcct.getOwners()%3B%0A%0A%0A%20%20%20%20%20%20%20%20boolean%20anotherNull%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20try%7B%0A%20%20%20%20%20%20%20%20jamesAcct.recordDailyBalance()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20catch(NullPointerException%20e)%7B%0A%20%20%20%20%20%20%20%20anotherNull%20%3D%20true%20%3B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20if(anotherNull)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22NullPointer%20Exception%20Error%2C%20looks%20like%20you%20never%20initialized%20dailyBalances%20in%20SavingsAccount%22)%3B%0A%20%20%20%20%20%20%20%20p2(%22Exiting%20testing%20program%22)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%0A%0A%20%20%20%20jamesAcct.updateInterestRate(3.3)%3B%0A%0A%20%20%20%20if(jamesAcct.getInterestRate()%20%3D%3D%203.3%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%2C%20probably%20re%3A%20updateInterestRate()%20%20or%20possibly%20getInterestRate()%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%20%20%20%20jamesAcct.recordDailyBalance()%3B%0A%20%20%20%20%0A%0A%20%20%20%20jamesAcct.deposit(22)%3B%0A%20%20%20%20jamesAcct.recordDailyBalance()%3B%0A%20%20%20%20jamesAcct.withdraw(100)%3B%0A%20%20%20%20jamesAcct.recordDailyBalance()%3B%0A%20%20%20%20jamesAcct.deposit(330)%3B%0A%20%20%20%20jamesAcct.recordDailyBalance()%3B%0A%0A%20%20%20%20%20ArrayList%3CDouble%3E%20%20dailyBalances%20%3D%20jamesAcct.getDailyBalances()%3B%20%0A%20%20%20%20%0A%20%20%20%20if(dailyBalances.get(0)%3D%3D%20666)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20%40%20dailyBalances%20index%200%22)%3B%0A%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%5Ct%201st%20element%20of%20dailyBalances%20should%20be%20666.00%22)%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20p2(%22exiting%20testing%20program%2C%20fix%20daily%20balances%20first%22)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%0A%20%20%20%20if(dailyBalances.get(1)%3D%3D%20666)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20%40%20dailyBalances%20index%201%22)%3B%0A%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%5Ct%202nd%20element%20of%20dailyBalances%20should%20be%20666.00%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20if(dailyBalances.get(2)%3D%3D%20688)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20%40%20dailyBalances%20index%202%22)%3B%0A%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%5Ct%203rd%20element%20of%20dailyBalances%20should%20be%20666.00%22)%20%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20if(dailyBalances.get(3)%3D%3D%20588)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20%40%20dailyBalances%20index%203%22)%3B%0A%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%5Ct%204th%20element%20of%20dailyBalances%20should%20be%20588.00%22)%20%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%20%20%20%20if(dailyBalances.get(4)%3D%3D%20918)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22error%20%40%20dailyBalances%20index%204%22)%3B%0A%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%5Ct%205th%20element%20of%20dailyBalances%20should%20be%20918.00%22)%20%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%0A%0A%20%20%20%20if(%20Account.getParentCode()%3D%3D%2012810)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22Account.getParentCode()%20wrong%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%2F%2FtoString%20Tests%0A%20%20%20%20%20%20%20%20String%20str%20%3D%20jamesAcct.toString()%3B%0A%0A%20%20%20%20if(str.indexOf(%22SavingsAccount%22)%20%3D%3D%200%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20should%20start%20w%2Fclassname.%20i.e.%20%5C%22SavingsAccount%5C%22%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20str%20%3D%20str.toLowerCase()%3B%0A%0A%20%20%20%20if(str.contains(%22number%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20Account%20number%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20if(str.contains(jamesAcct.getAccountNumber()%20%2B%22%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20Account%20number%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20if(str.contains(%22balance%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20re%3A%20account%20balance%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20if(str.contains(jamesAcct.getCurrentBalance()%20%2B%22%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20re%3A%20account%20balance%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%2F%2F%20ArrayList%3CPerson%3E%20getOwners()%20%20%20%20%0A%0A%20%20%20%20%0A%20%20%20%20if(str.contains(%22owner%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20re%3A%20Account%20Owners%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20ArrayList%3CPerson%3E%20jamesAcctOwners%20%3D%20jamesAcct.getOwners()%3B%0A%20%20%20%20for(Person%20p%20%3A%20jamesAcctOwners)%7B%0A%20%20%20%20%20%20%20%20String%20strName%20%3D%20p.getName().toLowerCase()%3B%0A%20%20%20%20if(str.contains(strName)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20re%3A%20Account%20Owners%22)%3B%0A%20%20%20%20%20%20%20%20if(verbose)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20p2(%22%5Ct%5Ct%20%22%20%2B%20str%20%2B%20%22%5Cn%20%5Ct%5Ct%5Ct%20Missing%20%22%20%2B%20strName)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2F%2Fend%20of%20for-each%0A%0A%0A%20%20%20%20if(str.contains(%22interest%20rate%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20re%3A%20interest%20rate%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20if(str.contains(jamesAcct.getInterestRate()%20%2B%20%22%22)%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20p2(%22toString()%20incorrectly%20formatted%2C%20re%3A%20interest%20rate%20%22)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%0A%0A%20%20%20%20Person%20jorge%20%3D%20new%20Person(%22jorge%22%2C%2017)%20%3B%0A%20%20%20%20CertificateOfDeposit%20cd_foo%20%3D%20new%20CertificateOfDeposit(jorge%2C%20500)%3B%0A%20%20%20%20cd_foo.withdraw(100%2C%20true)%3B%0A%20%20%20%20double%20jorgesMoney%20%3D%20cd_foo.getCurrentBalance()%3B%0A%20%20%20%20if(jorgesMoney%20%3D%3D%20200%20)%0A%20%20%20%20%20%20%20%20correct%2B%2B%3B%0A%20%20%20%20else%7B%0A%20%20%20%20%20%20%20%20wrong%2B%2B%3B%0A%20%20%20%20%20%20%20%20if(%20jorgesMoney%20%3D%3D%20400)%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22You%20did%20not%20apply%20the%20EARLY_WITHDRAW_PENALTY%20for%20a%20CD’s%20early%20withdrawal%22)%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20p2(%22Certificate%20of%20Deposit%20has%20wrong%20balance%20after%20early%20withdrawal%22)%3B%0A%0A%20%20%20%20%7D%0A%0A%0AAccount%20sb%20%3D%20new%20SavingsAccount(%20jorge%2C%20100%20)%3B%0AAccount%20sb2%20%3D%20new%20SavingsAccount(%20joe%2C%20100)%3B%0Aif(%20sb2.comparesTo(sb)%20%3D%3D%201)%0A%09correct%2B%2B%20%3B%0Aelse%0A%09%7B%0A%09wrong%2B%2B%3B%0A%09p2(%22Account’s%20comparesTo%20not%20implemented%20correctly%22)%3B%0A%09%7D%0A%0A%0ASavingsAccount%20sb33%20%3D%20new%20SavingsAccount(%20jorge%2C%20100%20)%3B%0A%0Asb33.updateInterestRate(3.3)%3B%0Aif(%20sb33.getInterestRate()%3D%3D%203.3)%0A%09correct%2B%2B%3B%0Aelse%0A%7B%0A%09wrong%2B%2B%3B%0A%09p2(%22Savings%20account%20error%20involving%20interestRate%22)%3B%0A%09p2(%22%5Ct%20either%20getInterestRate()%20or%20%2C%20more%20likely%2C%20updateInterestRate()%20is%20wrong%20%22)%3B%0A%0A%7D%0A%0A%0Adouble%20ball_yr1%20%3D%20sb33.projectBalance(1)%3B%0Aif(%20Math.abs(ball_yr1%20-%20103.350372874721)%3C%200.000001)%0A%09correct%2B%2B%20%3B%0Aelse%0A%09%7B%0A%09wrong%2B%2B%3B%0A%09p2(%22SavingAccount’s%20projectBalance()%20incorrect%22)%3B%0A%09%7D%0A%0A%0A%09p2(%22********************************************************************%22)%20%3B%0A%09p2(%22********************************************************************%22)%20%3B%0A%09p2(%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20SCORE%20%20%22)%20%3B%0A%09p2(%22********************************************************************%22)%20%3B%0A%09p2(%22********************************************************************%22)%20%3B%0A%09p2(%22********************************************************************%22)%20%3B%0A%0A%20%20%20%20p2(%22——————————-%22)%3B%0A%20%20%20%20p2(%22Correct%20%3A%20%20%22%20%2B%20correct)%3B%20%20%20%20%0A%20%20%20%20p2(%22Wrong%20%20%20%3A%20%20%22%20%2B%20wrong)%3B%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%7D%0A%0A%0Avoid%20p2(String%20s)%7B%0A%20%20%20%20System.out.println(s)%3B%0A%7D%0Avoid%20p2(int%20s)%7B%0A%20%20%20%20System.out.println(s)%3B%0A%7D%0Avoid%20p2(boolean%20s)%7B%0A%20%20%20%20System.out.println(s)%3B%0A%7D%0A%20%20%20%20%0A%0A%0A%7D%0A%20″ message=”Tester.java” highlight=”” provider=”manual”/]
When you are done, you can begin the Bank project .
Constructor
instance Variables
Accesor Methods
Now, let’s refactor our class relationships to represent our new Iheritance Tree