public SavingsAccount(Customer customer, decimal balance) { this.balance = balance; this.owner = customer; increment++; savingsAccountNumber = increment; }
public CashAccount(Customer customer, decimal balance) { this.balance = balance; this.owner = customer; increment++; cashAccountNumber = increment; }
static void Main(string[] args) { Customer benvolio = new Customer("Benvolio ", "Montague"); Creditcard credit1 = new Creditcard(benvolio, "554512345678", "0234"); CashAccount c1 = new CashAccount(benvolio, 10000); ATM myATM = ATM.getinstance(); try { myATM.InputCard(credit1); myATM.InputPin("0234"); myATM.RequestWithdrawal(c1, 9000); myATM.RequestBalance(c1); myATM.EjectCard(); } catch (UnauthorizedAccessException u) { Console.WriteLine(u.Message); } catch (IllegalOperationException i) { Console.WriteLine(i.Message); } catch (LimitExceedException l) { Console.WriteLine(l.Message); } Console.ReadKey(); }
public Creditcard(Customer owner, string cNumber, string pinCode) { this.owner = owner; this.cardNumber = cNumber; this.pinCode = pinCode; }