Question
Write a BankAccountTester class whose main method constructs a bank account, deposits $1,000, withdraws $500, withdraws another $400, and then prints the remaining balance. Also
Write a BankAccountTester class whose main method constructs a bank account, deposits $1,000, withdraws $500, withdraws another $400, and then prints the remaining balance. Also print the expected result.
Add a method public void addInterest(double rate) to the BankAccount class that adds interest at the given rate. For example, after the statements BankAccount momsSavings = new BankAccount(1000); momsSavings.addInterest(10); // 10 percent interest the balance in momsSavings is $1,100. Also supply a BankAccountTester class that prints the actual and expected balance
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