The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
PLEASE USE THE FOLLOWING TEST PROGRAM BELOW
11.3 (Subclasses of Account) In Programming Exercise 9.7, the Account class was defined to model a bank account. An account has the properties account number, balance, annual interest rate, and date created, and methods to deposit and withdraw funds. Create two subclasses for checking and saving accounts. A checking account has an overdraft limit, but a savings account cannot be overdrawn. Draw the UML diagram for the classes and then implement them. Write a test program that creates objects of Account, SavingsAccount, and CheckingAccount and invokes their toString() methods.
Â
Programming Exercise 11.3. Use the following test program:
public class Exercise11_03
{ public static void main(String[] args)
{ CheckingAccount checking = new CheckingAccount(1, 35);
SavingsAccount savings = new SavingsAccount(2, 25);
checking.withdraw(10);
savings.withdraw(10);
System.out.println(checking.getBalance());
System.out.println(savings.getBalance()); } }
Â