home *** CD-ROM | disk | FTP | other *** search
- public abstract class BankAccount {
- private static double m_dCurrentInterestRate;
- private double m_dBalance;
-
- public void Withdrawal(double dAmount) {
- if (dAmount >= (double)0.0F && dAmount <= this.m_dBalance) {
- this.m_dBalance -= dAmount;
- }
-
- }
-
- public void Interest() {
- this.m_dBalance += this.m_dBalance * (m_dCurrentInterestRate / (double)1200.0F);
- }
-
- BankAccount(double dInitialBalance) {
- this.m_dBalance = dInitialBalance;
- }
-
- public abstract int AccountNo();
-
- public void Monthly() {
- this.Fee();
- this.Interest();
- }
-
- public double Balance() {
- int nCents = (int)(this.m_dBalance * (double)100.0F + (double)0.5F);
- return (double)nCents / (double)100.0F;
- }
-
- public static double Rate() {
- return m_dCurrentInterestRate;
- }
-
- public static void Rate(double dNewRate) {
- if (dNewRate > (double)0.0F && dNewRate < (double)20.0F) {
- m_dCurrentInterestRate = dNewRate;
- }
-
- }
-
- public void Deposit(double dAmount) {
- if (dAmount > (double)0.0F) {
- this.m_dBalance += dAmount;
- }
-
- }
-
- public void Fee() {
- this.m_dBalance -= (double)5.0F;
- }
- }
-