using System;
public class BankAccount {
public static int nNextAccountNumber = 1000;
public int nAccountNumber;
public double dBalance;
public void InitBankAccount() {
nAccountNumber = ++nNextAccountNumber;
dBalance = 0.0;
}
public void Deposit(double dAmount) {
if (dAmount > 0.0) {
dBalance += dAmount;
}
}
public double Withdraw(double dWithdrawal) {
if (dBalance <= dWithdrawal) {
dWithdrawal = dBalance;
}
dBalance -= dWithdrawal;
return dWithdrawal;
}
}
|