Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Demo
- {
- class BankAccount
- {
- //полета
- private int id;
- private double balance;
- //методи
- public BankAccount()
- {
- //ctor + tab + tab
- //празен обект ->id = 0, balance = 0
- }
- public BankAccount(int id1, double balance1)
- {
- //обект -> id = id1, balance = balance1
- id = id1;
- balance = balance1;
- }
- public int Id {
- get
- {
- return id;
- }
- set
- {
- id = value;
- }
- }
- public double Balance
- {
- get
- {
- return balance;
- }
- set
- {
- balance = value;
- }
- }
- //deposit -> balance += sum
- public void Deposit (double sum)
- {
- this.balance += sum;
- }
- //withdraw -> balance -= sum
- public void Withdraw (double sum)
- {
- this.balance -= sum;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement