Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace atm_program
- {
- class Account
- {
- //Members
- private long acctNo;
- protected double balance;
- //Properties, get & set methods
- public long AcctNo
- {
- get { return acctNo; }
- set { acctNo = value; }
- }
- public double Balance
- {
- get { return balance; }
- }
- //Constructors
- //Note: No default constructors!
- public Account(long acctNumber)
- {
- acctNo = acctNumber;
- }
- // Methods
- public virtual double Deposit(double amount)
- {
- balance = amount + balance;
- return balance;
- }
- public virtual double Withdrawal(double amount)
- {
- balance = balance - amount;
- return amount;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement