-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathIt21357794-B.G.K.D.Sirisena
137 lines (124 loc) · 2.76 KB
/
It21357794-B.G.K.D.Sirisena
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//client.h
class client
{
protected:
int client_id;
char client_name[20];
char acctype[8];
char username[8];
char Password[8];
char address[15];
char phonenumber[12];
int postalcode;
char membertype[10];
public:
client();
client(int id, char name[],char actype[],char addr[], char pnumber[], int pcode);
~client();
void Register(char u_name[],char password[],char mtype[]);
void Editacc();
void Upgrade(char mtype[]);
void display();
};
//client.cpp
#include "client.h"
#include<cstring>
#include <iostream>
using namespace std;
client::client() {
client_id = 0;
strcpy(client_name, "");
strcpy(acctype, "");
strcpy(username, "");
strcpy(Password, "");
strcpy(address, "");
strcpy(phonenumber, "");
postalcode = 0;
strcpy(membertype, "");
}
client::client(int id,char name[],char actype[],char addr[],char pnumber[],int pcode) {
client_id = id;
strcpy(client_name,name);
strcpy(acctype,actype);
strcpy(address,addr);
strcpy(phonenumber,pnumber);
postalcode = pcode;
}
client::~client() {
cout << ("\nDestructor in process");
}
void client::Register(char u_name[], char password[],char mtype[]) {
strcpy(username,u_name);
strcpy(Password,password);
strcpy(membertype,mtype);
}
void client::Editacc() {
cout << "\nEnter new account details" << endl;
cout << "\nEnter your account id" << endl;
cin >> client_id;
cout << "\nEnter your address:" << endl;
cin >> address;
cout << "\nEnter your acc type:" << endl;
cin >> acctype;
cout << "\nEnter your phone number:" << endl;
cin >> phonenumber;
}
void client::Upgrade(char mtype[]){
cout << "\nEnter your new member type:" << endl;
cin >> membertype;
}
void client::display() {
cout << "\nClient details:" << endl;
cout << client_id << endl;
cout << client_name << endl;
cout << address << endl;
cout << phonenumber << endl;
cout << postalcode << endl;
cout << acctype<< endl;
cout <<username<< endl;
}
//payment.h
class payment
{
private:
int payment_id;
char payment_type[10];
double amount;
char date[10];
public:
payment();
payment(int pid,double pamount, char pdate[],char ptype[]);
void validateuser();
void printdetails();
~payment();
};
//payment.cpp
#include "payment.h"
#include <cstring>
#include <iostream>
#include "client.h"
using namespace std;
payment::payment() {
payment_id = 0;;
strcpy(payment_type,"");
amount=0;
strcpy(date,"");
}
payment::payment(int pid, double pamount, char pdate[], char ptype[]) {
payment_id = pid;;
strcpy(payment_type,ptype);
amount = pamount;
strcpy(date,pdate);
}
void payment::validateuser(){
cout << "Validated successfully" << endl;
}
void payment::printdetails() {
cout << date << endl;
cout << amount << endl;
cout << payment_type << endl;
cout << payment_id << endl;
}
payment::~payment() {
cout << "Destructor in process" << endl;
}