-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
42 lines (38 loc) · 827 Bytes
/
Copy pathMain.cpp
File metadata and controls
42 lines (38 loc) · 827 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
#include <iostream>
#include "Subject.h"
#include "AccountShare1.h"
#include "AccountShare2.h"
#include "JointBusinessAccount.h"
using namespace std;
int main()
{
subject sub;
string tmp;
cout << "enter the first share person name" << endl;
cin >> tmp;
accountShare1 sh1(&sub, tmp);
tmp.clear();
cout << "enter the first share person 2 name" << endl;
cin >> tmp;
accountShare2 sh2(&sub, tmp);
jointBusinessAccount jba(&sub);
jba.setAccountDetails();
int option;
double amount;
while (1)
{
cout << "enter the option 1 -> credit, 2->withdraw " << endl <<"enter the amount also";
cin >> option >> amount;
switch (option)
{
case 1:
jba.credit(amount);
break;
case 2:
jba.withdraw(amount);
break;
default:
cout << "invalid option";
}
}
}