Question: Next, look at the addMoney ( ) method. This method should add the value stored in the parameter balanceDollar to the instance variable balanceDollar. Before

Next, look at the addMoney() method. This method should add the value stored in the parameter balanceDollar to the instance variable balanceDollar. Before adding the money to the account, print out the statement "Adding ____ dollars to the account.". After adding the money, print the statement "The new balance is _____ dollars.". Be careful of spacing, capitalization, and punctuation with your print statements.
Call the addMoney() method once in the main() method to test your code. Add 2000 dollars to Zeuss account.
(Note that this function should probably be updating balanceEuro as well based on the parameter. We wont test your code for that, but you can try implementing it yourself. Also, note that balanceDollar is a pretty bad name for the parameter of this function. Something like moneyToAdd would make more sense. But for the sake of practicing local variables vs instance variables, keep the parameter named balanceDollar.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!