Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started