-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.cpp
More file actions
44 lines (34 loc) · 736 Bytes
/
account.cpp
File metadata and controls
44 lines (34 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include "account.h"
using namespace std;
namespace banking_system
{
Account::Account() {}
Account::Account(string name, double balance)
{
_name = name;
_balance = balance;
}
Account::~Account() {}
string Account::Name()
{
return _name;
}
void Account::Deposit(double amount)
{
_balance += amount;
}
void Account::Withdraw(double amount)
{
_balance -= amount;
}
double Account::Balance()
{
return _balance;
}
void Account::Print()
{
cout << "Name: " << Name() << endl;
cout << "Balance: " << Balance() << endl;
}
}