-
Notifications
You must be signed in to change notification settings - Fork 1
/
MemeberFunctions.h
106 lines (90 loc) · 2.38 KB
/
MemeberFunctions.h
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Member Functions Definition
#include "class.h" // class Definition
#include <iostream>
#include <iomanip>
using namespace std;
int Unique = 0;
// defintion of create account
void Account ::create_account()
{
cout << "\nGreetings You are welcome to our Portfolio\n";
cout << "\nEnter The Account Number : ";
cin >> acc_no;
while (cin.fail())
// Not an int value
{
cout << "\nError !!! Account Number Should be a number type(int)" << endl;
cin.clear();
cin.ignore(256, '\n');
cin >> acc_no;
}
cout << "\nEnter The Name of The Account Holder : ";
cin.ignore();
cin.getline(name, 50);
cout << "\nEnter Type of The Account *Current or *Saving (C/S) : ";
cin >> type;
if (type != 's' || type != 'S' || type != 'c' || type != 'C')
type = 'S';
type = toupper(type);
cin.ignore();
cout << "\nEnter the Initial amount (greater than 500 for Saving and greater than 1000 for current) : ";
cin >> deposit;
Unique = acc_no;
// cout << "\n\nAccount Created.........";
}
// defintion of show account
void Account ::show_account()
{
cout << "\nAccount No. : " << acc_no;
cout << "\nAccount Holder Name : ";
cout << name;
cout << "\nType of Account : " << type;
cout << "\nBalance amount : " << deposit;
}
// defintion of modify func
void Account ::modify()
{
cout << "\nAccount No. : " << acc_no;
cout << "\nModify Account Holder Name : ";
cin.ignore();
cin.getline(name, 50);
cout << "\nModify Type of Account : ";
cin >> type;
type = toupper(type);
cout << "\nModify Balance amount : ";
cin >> deposit;
}
// definition of deposit_money func
void Account ::deposit_money(int x)
{
deposit += x;
}
// defintion of draw func
void Account ::draw(int x)
{
deposit -= x;
}
// defintion of report func
void Account ::report()
{
// cout << acc_no << setw(20) << " " << name << setw(15) << " " << type << setw(17) << deposit << endl;
cout << setw(2) << setfill(' ') << acc_no;
cout << setw(25) << setfill(' ') << name;
cout << setw(14) << setfill(' ') << type;
cout << setw(20) << setfill(' ') << deposit;
}
// definition of retaccno
int Account ::retaccno()
{
return acc_no;
}
// defintion of return deposit
int Account ::retdeposit()
{
return deposit;
}
// definition of rettype func
char Account ::rettype()
{
return type;
}