A bank offers its customers two kinds of account – a regular account and a gold account. The two types of account provide some shared facilities but they also offer distinctive features. The common facilities are:
open an account with a name and an initial balance;
maintain a record of the current balance;
deposit or withdraw an amount of money
Whenever a withdrawal is made, a regular account is checked to see if the account is overdrawn. A gold account holder can overdraw indefinitely. A regular account has interest calculated as 5% of the amount. A gold account has interest at 6%, less a fixed charge of $100 per year.
Write a class that describes the common features and individual classes to describe regular and gold accounts.
Construct a program to use these classes by creating two bank accounts – one a regular account and the other a gold account. Each is created with a person’s name and some initial amount of money. Place the objects representing each account in an array list. Display the name, balance and interest of the accounts in a text area when a button is clicked on. (Assume for simplicity that amounts of money are held as int.)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here