-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (29 loc) · 904 Bytes
/
main.cpp
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
#include <iostream>
#include "Account.h"
#include "Saving_Account.h"
using namespace std;
int main()
{
cout << "\n=== Account =============================================" << endl;
Account acc{};
acc.deposit(2000.0);
acc.withdraw(500.0);
cout << endl;
Account *p_acc{nullptr};
p_acc = new Account{};
p_acc->deposit(1000.0);
p_acc->withdraw(500.0);
delete p_acc;
cout << "\n=== Saving Account =====================================" << endl;
Saving_Account sav_acc{};
sav_acc.deposit(2000.0);
sav_acc.withdraw(500.0);
cout << endl;
Saving_Account *p_sav_acc{nullptr};
p_sav_acc = new Saving_Account();
p_sav_acc->deposit(1000.0);
p_sav_acc->withdraw(500.0);
delete p_sav_acc;
cout << "\n============================================================" << endl;
return 0;
}