Skip to content

Instantly share code, notes, and snippets.

Created October 17, 2012 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3903417 to your computer and use it in GitHub Desktop.
Save anonymous/3903417 to your computer and use it in GitHub Desktop.
Bank account
public abstract class BankAccount {
private double balance;
private int nodmonth;
private int nowithdrawals;
private double deposit;
BankAccount()
{
balance=0;
nodmonth=0;
nowithdrawals=0;
deposit = 0;
}
public void Balance(double b)
{
balance=b;
}
public void Deposit(double d)
{
balance=balance+d;
deposit = d;
nodmonth++;
}
public void Withdrawal(double w)
{
balance=balance-w;
nowithdrawals++;
}
public double getBalance()
{
return balance;
}
public int getNodmonth()
{
return nodmonth;
}
public double getDeposit()
{
return deposit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment