public class BankCustomer {
private int customerId;
private String name;
private double baseAmount;
private String accountType;
public BankCustomer(int customerId, String name, double baseAmount, String accountType)
{
this.customerId = customerId;
this.name = name;
this.baseAmount = baseAmount;
this.accountType = accountType;
}
public void widthdrawAmount(int amount)
{
if(amount > 0 && baseAmount >= amount)
baseAmount-=amount;
}
public void addAmount(int amount)
{
if(amount > 0)
baseAmount += amount;
}
}
Comments
Leave a comment