-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.c
188 lines (183 loc) · 3.58 KB
/
project.c
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define acc 100
struct customer
{
char fname[50];
char lname[50];
long long int dob;
long long int aadhar;
long long int amount;
}
customer[acc];
int main()
{
int y[1000],i=0,j,d,ch,l;
int N,n;
int an;
int z[8],w=0,x,flag=0;
long long int deposit,withdraw;
home:
printf("\twelcome to my bank\n");
printf("Select an option from below\n");
printf("1-->Banking customer record\n");
printf("2-->transaction portal\n");
scanf("%d",&N);
switch(N)
{
case 1:
printf("\n\tBanking Record System\n");
printf("Select one option below\n");
printf("3-->Add record to the file\n");
printf("4-->search record from the file\n");
printf("5-->Update record\n");
printf("6-->Delete record\n");
printf("7-->Quit\n");
scanf("%d",&n);
switch(n)
{
case 3:
start:
printf("enter account number\n");
scanf("%d",&an);
y[i]=an;
i=i+1;
printf("enter customer's first name\n");
scanf("%s",customer[an].fname);
printf("enter customer last name\n");
scanf("%s",customer[an].lname);
printf("enter date of birth(ddmmyyyy)");
scanf("%lld",&customer[an].dob);
printf("enter aadhar number");
scanf("%lld",&customer[an].aadhar);
printf("enter balance amount\n");
scanf("%lld",&customer[an].amount);
printf("\t record added successfully\n");
goto home;
break;
case 4:
printf("Enter the account number\n");
scanf("%d",&an);
for(j=0;j<i;j++)
{
if(y[j]==an)
flag=1;
}
if(flag==1)
{
x=customer[an].dob;
while(x>0)
{
d=x%10;
z[w]=d;
x=x/10;
w++;
}
w=0;
printf("name-%s %s\n",customer[an].fname,customer[an].lname);
printf("date of birth-%d%d-%d%d-%d%d%d%d\n",z[7],z[6],z[5],z[4],z[3],z[2],z[1],z[0]);
printf("aadhar number-%lld\n",customer[an].aadhar);
printf("balance amount-%lld\n",customer[an].amount);
flag=0;
goto home;
}
else
printf("record not found");
goto home;
break;
case 5:
goto start;
break;
case 6:
printf("enter account number");
scanf("%d",&an);
for(l=0;l<50;l++)
{
customer[an].fname[l]= '\0';
customer[an].lname[l]= '\0';
}
customer[an].dob=0;
customer[an].aadhar=0;
customer[an].amount=0;
for(j=0;j<i;j++)
{
if(y[j]==an)
{
y[j]='\0';
}
}
goto home;
break;
case 7:
goto home;
break;
default:
printf("wrong choice\n");
goto home;
break;
}
case 2:
printf("enter your choice\n");
printf("8-->to deposite money\n");
printf("9-->to withdraw money\n");
printf("10-->go to home\n");
scanf("%d",&ch);
switch(ch)
{
case 8:
printf("enter the account nnumber");
scanf("%d",&an);
printf("enter the amount to be deposited");
scanf("%lld",&deposit);
printf("name of the account holder %s %s\n",customer[an].fname,customer[an].lname);
printf("aadhar number of the account holder %lld\n",customer[an].aadhar);
x=customer[an].dob;
while(x>0)
{
d=x%10;
z[w]=d;
x=x/10;
w++;
}
printf("date of birth-%d%d-%d%d-%d%d%d%d\n",z[7],z[6],z[5],z[4],z[3],z[2],z[1],z[0]);
printf("balance of the account holder%lld\n",(customer[an].amount+deposit));
customer[an].amount=customer[an].amount+deposit;
goto home;
break;
case 9:
printf("enter the account number");
scanf("%d",&an);
printf("enter the amount to be withdrawn");
scanf("%lld",&withdraw);
printf("name of the account holder %s %s\n",customer[an].fname,customer[an].lname);
printf("aadhar number of the account holder %lld\n",customer[an].aadhar);
x=customer[an].dob;
while(x>0)
{
d=x%10;
z[w]=d;
x=x/10;
w++;
}
printf("date of birth-%d%d-%d%d-%d%d%d%d\n",z[7],z[6],z[5],z[4],z[3],z[2],z[1],z[0]);
printf("balance of the account holder %lld\n",customer[an].amount-withdraw);
customer[an].amount=customer[an].amount-withdraw;
goto home;
break;
case 10:
goto home;
break;
default:
printf("wrong choice");
goto home;
}
goto home;
break;
default:
printf("wrong choice");
goto home;
break;
}
return 0;
}