-
Notifications
You must be signed in to change notification settings - Fork 0
/
final.cpp
58 lines (51 loc) · 944 Bytes
/
final.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
#include <iostream>
#include <string.h>
using namespace std;
class account
{
protected:
char name[32];
char address[32];
int acc_no;
};
class saving : public account
{
public:
int account_type;
void assign(const char *nam, const char *add, int acc)
{
strcpy(name,nam);
strcpy(address,add);
acc_no=acc;
}
};
class fixeds : public account
{
public:
int account_type;
void assign(const char *nam, const char *add, int acc)
{
strcpy(name,nam);
strcpy(address,add);
acc_no=acc;
}
};
int main()
{
int c;
saving s;
fixeds f;
cout << "enter 1 for saving and 2 for fixed";
cin >> c;
switch(c)
{
case 1:
s.assign("rt", "dhulikhel", 1234);
break;
case 2:
f.assign("rt", "dhulikhel", 1234);
break;
default:
cout << "no any choices";
}
}