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