-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclass1.cpp
81 lines (72 loc) · 1.57 KB
/
class1.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
72
73
74
75
76
77
78
79
80
81
//***************************
//CLASS FOR CUSTOMERS
//***************************
class customer
{
int cno;
char name[10];
float mbno;
int points;
public :
void create_cust()
{
clrscr();
cout<<"\n...NEW CUSTOMER ENTRY...\n";
cout<<"\nEnter the customer number : ";
cin>>cno;
cout<<"\nEnter the name of the customer : ";
gets(name);
cout<<"\nEnter mobile number : ";
cin>>mbno;
points=0;
}
void show_cust()
{
clrscr();
cout<<"\nCustomer number : "<<cno;
cout<<"\nCustomer name : ";
puts(name);
cout<<"\nMobile number : "<<mbno;
if(points>0)
{
cout<<"\nBonus points : "<<points;
}
}
void modify_cust()
{
clrscr();
char reply;
cout<<"\nwhat do you want to modify?";
cout<<"\nC. Customer Number";
cout<<"\nN. Name";
cout<<"\nM. Mobile Number";
cin>>reply;
if(reply=='C'&& reply=='c')
{
cout<<"\nNew customer number : ";
cin>>cno;
}
else if(reply=='N' && reply=='n')
{
cout<<"\nNew name : ";
cin>>name;
}
else if(reply=='M' && reply=='m')
{
cout<<"\nNew mobile number : ";
cin>>mbno;
}
}
void add_points()
{ points++; }
void reset_points()
{ points=0; }
int return_cno()
{ return cno; }
int return_points()
{ return points; }
int return_mbno()
{ return mbno; }
void report()
{ cout<<"\t"<<cno<<name<<points<<endl; }
}c1;