PetkoPedev

BankAccount.cs

Feb 13th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. public class BankAccount
  6. {
  7. int id;
  8. public int ID
  9. {
  10. get { return id; }
  11. set { id = value; }
  12. }
  13.  
  14. decimal balance;
  15. public decimal Balance
  16. {
  17. get { return balance; }
  18. set { balance = value; }
  19. }
  20.  
  21. public void Deposit(decimal amount)
  22. {
  23. Balance += amount;
  24. }
  25.  
  26. public void Withdraw(decimal amount)
  27. {
  28. Balance -= amount;
  29. }
  30.  
  31. public override string ToString()
  32. {
  33. return $"Account {ID}, balance {Balance}";
  34. }
  35. }
Add Comment
Please, Sign In to add comment