-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
71 lines (56 loc) · 1.17 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//============================================================================
// Name : investment.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include "investment.h"
#include "recurringdeposit.h"
#include "fixeddeposit.h"
#include "sharemarket.h"
using namespace std;
int main() {
int i;
int choice;
investment*ptr[3];
for(i=0;i<3;i++)
{
cout<<"0.exit"<<endl;
cout<<"1.recurringdeposit"<<endl;
cout<<"2.fixeddeposit"<<endl;
cout<<"3.sharemarket"<<endl;
cout<<"enter choice"<<endl;
cin>>choice;
switch(choice)
{
case 1:
ptr[i]= new recurringdeposit;
break;
case 2:
ptr[i]= new fixeddeposit;
break;
case 3:ptr[i]= new sharemarket;
break;
}
ptr[i]->acceptamount();
}
float total;
for(i=0;i<3;i++)
{
total= total+ptr[i]->totalinvestment();
}
cout<<"total investment of customers is:"<<total<<endl;
float sum;
for(i=0;i<3;i++)
{
sum = sum+ptr[i]->maturity();
}
cout<<"total maturity of of customers is:"<<sum<<endl;
for(i=0;i<3;i++)
{
delete ptr[i];
}
return 0;
}