-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mobile Number Directory Management.fprg
529 lines (529 loc) · 42.4 KB
/
Mobile Number Directory Management.fprg
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="91988"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2021-02-04 09:18:38 PM"/>
<attribute name="created" value="OTE5ODg7TEFQVE9QLUlLS1UzT0ZBOzIwMjAtMTItMjg7MTA6MTY6MTggUE07MjYzNQ=="/>
<attribute name="edited" value="RGVMTDtERVNLVE9QLUpMS0JUOVA7MjAyMS0wMS0wMTswNDo1MjowMyBBTTs5NzsyODM3"/>
<attribute name="edited" value="SmVnYWRpdDtMQVBUT1AtMkZDRjNTUUQ7MjAyMS0wMS0wNTsxMDo1NzozMiBQTTs3NTszMTg1"/>
<attribute name="edited" value="OTE5ODg7TEFQVE9QLUlLS1UzT0ZBOzIwMjEtMDEtMDY7MDc6MjA6NTMgQU07MTs5MTk4ODtMQVBUT1AtSUtLVTNPRkE7MjAyMC0xMi0yODsxMDoxNjoxOCBQTTtNb2JpbGUgTnVtYmVyIERpcmVjdG9yeSBNYW5hZ2VtZW50LmZwcmc7OTIzNg=="/>
<attribute name="edited" value="OTE5ODg7TEFQVE9QLUlLS1UzT0ZBOzIwMjEtMDItMDQ7MDk6MDE6MjMgUE07OTY7Mjc5Nw=="/>
<attribute name="edited" value="RGVMTDtTQU5UT1NIOzIwMjEtMDItMDQ7MDk6MTg6MzggUE07NDk7MjMxNw=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="i, n, ch, ctr, leng, size, j, count, spc" type="Integer" array="False" size=""/>
<declare name="CustomerName, HouseName, Locality, District, ServiceProvider, Mobileno, det, from, to" type="String" array="True" size="50"/>
<declare name="choice, c, cn, num, sp, hn, chh, loc, dis" type="String" array="False" size=""/>
<assign variable="ctr" expression="0"/>
<assign variable="spc" expression="0"/>
<for variable="i" start="0" end="49" direction="inc" step="1">
<assign variable="CustomerName[i]" expression=""Null""/>
<assign variable="det[i]" expression=""Null""/>
<assign variable="from[i]" expression=""Null""/>
<assign variable="to[i]" expression=""Null""/>
<assign variable="District[i]" expression=""Null""/>
</for>
<output expression=""Amrita Vishwa Vidyapeetham Department of Computer Science and Engineering 19CSE100- Problem Solving and Engineering 2020-24 Batch First Semester Project on Mobile Number Directory Management Submitted by: CCEA Team 12 B R Aravind Ragav (CCEA.15893)- CB.EN.U4CCE20008 Chilaka Sohith Reddy (CCEA.65032)- CB.EN.U4CCE20012 Santosh (CCEA.69013)- CB.EN.U4CCE20053 Sudhan Sarvanan (CCEA.37503)- CB.EN.U4CCE20061 Vudattu Sreya Sahithi (CCEA.65621)- CB.EN.U4CCE20072"" newline="True"/>
<do expression="((choice=="y")||(choice=="Y"))">
<output expression=""A Hearty Welcome to our Project on Mobile Number Directory Management. Please select one based on your choice: 1. New Registration Searching: 2. Given a mobile number, name of the customer 3. List of customers who uses mobile service by a particular service provider 4. Given a name, mobile number(s) of that particular customer Update Details: 5. Change in Service Provider - Mobile Number Porting. 6. Change in House Name, Locality and District. 7. Adding a new number for an existing customer. Reports: 8. Details of a particular customer. 9. Percentage of mobile number(s) in a given district based on service provider. 10. Details of customer(s) who changed their service providers along with the reason."" newline="True"/>
<input variable="ch"/>
<if expression="(ch==1)">
<then>
<assign variable="c" expression=""y""/>
<while expression="((c=="y")||(c=="Y"))">
<output expression=""Kindly enter the details of the new Customer as asked!"" newline="True"/>
<output expression=""Customer Name:"" newline="True"/>
<input variable="CustomerName[ctr]"/>
<assign variable="leng" expression="Len(CustomerName[ctr])"/>
<declare name="reee" type="Integer" array="False" size=""/>
<assign variable="reee" expression="1"/>
<while expression="reee!=0">
<for variable="i" start="0" end="leng-1" direction="inc" step="1">
<if expression="(((char(CustomerName[ctr],i)>="a")&&(char(CustomerName[ctr],i)<="z"))||((char(CustomerName[ctr],i)>="A")&&(char(CustomerName[ctr],i)<="Z"))||(char(CustomerName[ctr],i)<=" ")||(char(CustomerName[ctr],i)<="."))">
<then/>
<else>
<assign variable="reee" expression="(reee+1)"/>
</else>
</if>
</for>
<if expression="(reee>1)">
<then>
<assign variable="reee" expression="1"/>
<output expression=""Kindly Enter a Valid Input:"" newline="True"/>
<input variable="CustomerName[ctr]"/>
<assign variable="leng" expression="Len(CustomerName[ctr])"/>
</then>
<else>
<assign variable="reee" expression="0"/>
</else>
</if>
</while>
<output expression=""House Name: "" newline="True"/>
<input variable="HouseName[ctr]"/>
<output expression=""Locality: "" newline="True"/>
<input variable="Locality[ctr]"/>
<output expression=""District: "" newline="True"/>
<input variable="District[ctr]"/>
<output expression=""Our Service Providers are Airtel, Vi, Jio and BSNL. Kindly enter any one of your choice! Make sure you enter the right spelling along with the Uppercase for the first letter."" newline="True"/>
<input variable="ServiceProvider[ctr]"/>
<if expression="((Serviceprovider[ctr]=="Airtel") || (Serviceprovider[ctr]=="Vi") || (Serviceprovider[ctr]=="Jio") || (Serviceprovider[ctr]=="BSNL"))">
<then/>
<else>
<do expression="((ServiceProvider[ctr]!= "Airtel") && (ServiceProvider[ctr]!= "Vi") && (ServiceProvider[ctr]!= "Jio") && (ServiceProvider[ctr]!= "BSNL"))">
<output expression=""Kindly enter a Service Provider based on the above conditions:"" newline="True"/>
<input variable="ServiceProvider[ctr]"/>
</do>
</else>
</if>
<output expression=""Mobile Number: (10 DIGITS ONLY allowed)"" newline="True"/>
<input variable="Mobileno[ctr]"/>
<if expression="(Len(Mobileno[ctr])!=10)">
<then>
<do expression="(Len(Mobileno[ctr])!=10)">
<output expression=""Kindly enter a Mobile Number based on the above conditions:"" newline="True"/>
<input variable="Mobileno[ctr]"/>
</do>
</then>
<else/>
</if>
<output expression=""The number " &Mobileno[ctr]& " has been added succesfully for the customer (Mr./Ms.) " &CustomerName[ctr]& ". "" newline="True"/>
<assign variable="ctr" expression="ctr+1"/>
<output expression=""To add more new customers, press (Y/y) or any other key to terminate!"" newline="True"/>
<input variable="c"/>
<assign variable="size" expression="ctr"/>
</while>
</then>
<else>
<if expression="(ch==2)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<output expression=""Enter the mobile number:"" newline="True"/>
<input variable="num"/>
<call expression="cusnamesea(Mobileno,num,CustomerName,size)"/>
<output expression=""To find customer for another number, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==3)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<output expression=""Enter the name of the Service Provider:"" newline="True"/>
<input variable="sp"/>
<call expression="spdis(ServiceProvider,sp,CustomerName,size)"/>
<output expression=""To find the List for any other Service Providers, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==4)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<output expression=""Enter the Customer Name:"" newline="True"/>
<input variable="cn"/>
<call expression="mobnumsea(Mobileno,cn,CustomerName,size)"/>
<output expression=""To find the mobile numbers of any other customers, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==5)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<assign variable="count" expression="0"/>
<output expression=""Kindly enter the details to be changed as asked!"" newline="True"/>
<output expression=""Customer Name:"" newline="True"/>
<input variable="cn"/>
<output expression=""Mobile Number:"" newline="True"/>
<input variable="num"/>
<output expression=""Enter the Service Provider (Airtel, Jio, Vi, BSNL) to whom the number has to be changed:"" newline="True"/>
<input variable="sp"/>
<for variable="i" start="0" end="size-1" direction="inc" step="1">
<if expression="((CustomerName[i]==cn)&&(Mobileno[i]==num))">
<then>
<assign variable="from[i]" expression="ServiceProvider[i]"/>
<output expression=""Enter the reason for changing your Service Provider:"" newline="True"/>
<input variable="det[i]"/>
<assign variable="ServiceProvider[i]" expression="sp"/>
<output expression=""The number has been successfully to your requested Service Provider - " &sp& "."" newline="True"/>
<assign variable="to[i]" expression="sp"/>
<assign variable="spc" expression="spc+1"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""Kindly check the details again as there is no such customer with this name/mobile number registered in the Directory!"" newline="True"/>
</then>
<else/>
</if>
<output expression=""To change the Service Provider for any other number, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==6)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<assign variable="count" expression="0"/>
<output expression=""Enter the Customer Name:"" newline="True"/>
<input variable="cn"/>
<output expression=""Enter the Mobile Number:"" newline="True"/>
<input variable="num"/>
<output expression=""Kindly enter the details to be changed as asked!"" newline="True"/>
<output expression=""House Name:"" newline="True"/>
<input variable="hn"/>
<output expression=""Locality:"" newline="True"/>
<input variable="loc"/>
<output expression=""District:"" newline="True"/>
<input variable="dis"/>
<for variable="i" start="0" end="size-1" direction="inc" step="1">
<if expression="((CustomerName[i]==cn)&&(Mobileno[i]==num))">
<then>
<assign variable="HouseName[i]" expression="hn"/>
<assign variable="locality[i]" expression="loc"/>
<assign variable="District[i]" expression="dis"/>
<output expression=""The Changes in the Address has been performed Successfully!"" newline="True"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""Kindly check the details again as there is no such customer with the name/mobile number/House Name/Locality/District registered in the Directory!"" newline="True"/>
</then>
<else/>
</if>
<output expression=""To change the Address for any other customer, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==7)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<assign variable="count" expression="0"/>
<output expression=""Enter the Customer Name:"" newline="True"/>
<input variable="cn"/>
<output expression=""Enter the New number to be added:"" newline="True"/>
<input variable="num"/>
<output expression=""Enter the Service Provider you gonna use for this new number:"" newline="True"/>
<input variable="sp"/>
<assign variable="j" expression="size"/>
<assign variable="Mobileno[j]" expression="num"/>
<assign variable="ServiceProvider[j]" expression="sp"/>
<for variable="i" start="0" end="size-1" direction="inc" step="1">
<if expression="(CustomerName[i]==cn)">
<then>
<assign variable="CustomerName[j]" expression="CustomerName[i]"/>
<assign variable="HouseName[j]" expression="HouseName[i]"/>
<assign variable="locality[j]" expression="locality[i]"/>
<assign variable="District[j]" expression="District[i]"/>
<assign variable="size" expression="(size+1)"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""The name of (Mr./Ms.) " &cn& " has not been registered in the Directory!"" newline="True"/>
</then>
<else>
<output expression=""The Number has been added along with the Customer's other Details successfully!"" newline="True"/>
</else>
</if>
<output expression=""To add a new number for any other existing customer, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==8)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="((chh=="y")||(chh=="Y"))">
<assign variable="count" expression="0"/>
<output expression=""Enter the Customer Name:"" newline="True"/>
<input variable="cn"/>
<call expression="dispdet(cn,CustomerName,HouseName,Locality,District,ServiceProvider,Mobileno,size)"/>
<output expression=""To get the details for any other customer, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==9)">
<then>
<assign variable="chh" expression=""y""/>
<while expression="(chh=="y")||(chh=="Y")">
<output expression=""Enter the District Name:"" newline="True"/>
<input variable="dis"/>
<call expression="percendisp(District,ServiceProvider,dis,size)"/>
<output expression=""To get a similar report from any other district, press (Y/y) or any other key to terminate searching!"" newline="True"/>
<input variable="chh"/>
</while>
</then>
<else>
<if expression="(ch==10)">
<then>
<call expression="Changedisp(spc,CustomerName,Mobileno,from,to,det)"/>
</then>
<else>
<output expression=""Kindly enter a Valid Number from the given List of Numbers in the Menu by continuing the program again!"" newline="True"/>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
<output expression=""To continue with another functionality, press (Y/y) or else any other key to terminate!"" newline="True"/>
<input variable="choice"/>
</do>
<output expression=""Hope you enjoyed the Program! Thank you. :)"" newline="True"/>
</body>
</function>
<function name="Changedisp" type="None" variable="">
<parameters>
<parameter name="sc" type="Integer" array="False"/>
<parameter name="cusname" type="String" array="True"/>
<parameter name="mn" type="String" array="True"/>
<parameter name="fr" type="String" array="True"/>
<parameter name="t" type="String" array="True"/>
<parameter name="de" type="String" array="True"/>
</parameters>
<body>
<declare name="i" type="Integer" array="False" size=""/>
<output expression=""Number of people who have changed the Service providers of their Mobile Numbers: "&sc" newline="True"/>
<if expression="(sc==0)">
<then/>
<else>
<output expression=""Details of the customers who changed their Service Providers is as follows:"" newline="True"/>
<for variable="i" start="0" end="49" direction="inc" step="1">
<if expression="((t[i]!="Null")&&(de[i]!="Null"))">
<then>
<output expression=""Customer Name: " &cusname[i]" newline="True"/>
<output expression=""Mobile Number: " &mn[i]" newline="True"/>
<output expression=""Previous Service Provider: " &fr[i]" newline="True"/>
<output expression=""Current Service Provider: " &t[i]" newline="True"/>
<output expression=""Reason for the Change: " &de[i]" newline="True"/>
</then>
<else/>
</if>
</for>
</else>
</if>
</body>
</function>
<function name="cusnamesea" type="None" variable="">
<parameters>
<parameter name="mn" type="String" array="True"/>
<parameter name="no" type="String" array="False"/>
<parameter name="cusname" type="String" array="True"/>
<parameter name="s" type="Integer" array="False"/>
</parameters>
<body>
<declare name="count, i" type="Integer" array="False" size=""/>
<assign variable="count" expression="0"/>
<for variable="i" start="0" end="s-1" direction="inc" step="1">
<if expression="(mn[i]==no)">
<then>
<output expression=""The number " &no& " belongs to the customer (Mr./Ms.) " &cusname[i]& "."" newline="True"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""There is no customer with number " &no& " registered in the Directory!"" newline="True"/>
</then>
<else/>
</if>
</body>
</function>
<function name="dispdet" type="None" variable="">
<parameters>
<parameter name="cnn" type="String" array="False"/>
<parameter name="cusname" type="String" array="True"/>
<parameter name="houname" type="String" array="True"/>
<parameter name="loc" type="String" array="True"/>
<parameter name="dis" type="String" array="True"/>
<parameter name="sp" type="String" array="True"/>
<parameter name="mn" type="String" array="True"/>
<parameter name="s" type="Integer" array="False"/>
</parameters>
<body>
<declare name="count, i" type="Integer" array="False" size=""/>
<assign variable="count" expression="0"/>
<output expression=""Details of the Customer are as follows:-"" newline="True"/>
<for variable="i" start="0" end="s-1" direction="inc" step="1">
<if expression="(cusname[i]==cnn)">
<then>
<output expression=""Customer ID: " &(i+1)" newline="True"/>
<output expression=""*Customer Name: " &cusname[i]" newline="True"/>
<output expression=""*House Name: " &houname[i]" newline="True"/>
<output expression=""*Locality: " &loc[i]" newline="True"/>
<output expression=""*District: " &dis[i]" newline="True"/>
<output expression=""*Service Provider: " &sp[i]" newline="True"/>
<output expression=""*Mobile Number: " &mn[i]" newline="True"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""Kindly check the details again as there is no such customer with this name/mobile number registered in the Directory!"" newline="True"/>
</then>
<else/>
</if>
</body>
</function>
<function name="mobnumsea" type="None" variable="">
<parameters>
<parameter name="mn" type="String" array="True"/>
<parameter name="cnn" type="String" array="False"/>
<parameter name="cusname" type="String" array="True"/>
<parameter name="s" type="Integer" array="False"/>
</parameters>
<body>
<declare name="count, i" type="Integer" array="False" size=""/>
<assign variable="count" expression="0"/>
<output expression=""Mobile Numbers belonging to Customer (Mr./Ms.) " &cnn& " is/are:"" newline="True"/>
<for variable="i" start="0" end="s-1" direction="inc" step="1">
<if expression="(cusname[i]==cnn)">
<then>
<output expression=""Mobile Number: " &mn[i]" newline="True"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""There are no number belonging to the customer " &cnn& " in the Directory!"" newline="True"/>
</then>
<else/>
</if>
</body>
</function>
<function name="percendisp" type="None" variable="">
<parameters>
<parameter name="dis" type="String" array="True"/>
<parameter name="sp" type="String" array="True"/>
<parameter name="d" type="String" array="False"/>
<parameter name="s" type="Integer" array="False"/>
</parameters>
<body>
<declare name="suma, sumv, sumj, sumb, sumtot, i, count" type="Integer" array="False" size=""/>
<assign variable="count" expression="0"/>
<assign variable="suma" expression="0"/>
<assign variable="sumv" expression="0"/>
<assign variable="sumj" expression="0"/>
<assign variable="sumb" expression="0"/>
<assign variable="sumtot" expression="0"/>
<for variable="i" start="0" end="s-1" direction="inc" step="1">
<if expression="(dis[i]==d)">
<then>
<if expression="(sp[i]=="Airtel")">
<then>
<assign variable="suma" expression="(suma+1)"/>
</then>
<else>
<if expression="(sp[i]=="Vi")">
<then>
<assign variable="sumv" expression="(sumv+1)"/>
</then>
<else>
<if expression="(sp[i]=="Jio")">
<then>
<assign variable="sumj" expression="(sumj+1)"/>
</then>
<else>
<if expression="(sp[i]=="BSNL")">
<then>
<assign variable="sumb" expression="(sumb+1)"/>
</then>
<else/>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
<assign variable="sumtot" expression="sumtot+1"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""There is no District Name as " &d& "registered in the Directory!"" newline="True"/>
</then>
<else>
<output expression=""The Percentage Divisions of the Registered Service Providers at the District " &d& " :-"" newline="True"/>
<output expression=""*Percentage of Customers using Services of Airtel are " &((suma/sumtot)*100)" newline="True"/>
<output expression=""*Percentage of Customers using Services of Vi are " &((sumv/sumtot)*100)" newline="True"/>
<output expression=""*Percentage of Customers using Services of Jio are "&((sumj/sumtot)*100)" newline="True"/>
<output expression=""*Percentage of Customers using Services of BSNL are "&((sumb/sumtot)*100)" newline="True"/>
</else>
</if>
</body>
</function>
<function name="spdis" type="None" variable="">
<parameters>
<parameter name="sepr" type="String" array="True"/>
<parameter name="spchk" type="String" array="False"/>
<parameter name="cusname" type="String" array="True"/>
<parameter name="s" type="Integer" array="False"/>
</parameters>
<body>
<declare name="count, i" type="Integer" array="False" size=""/>
<assign variable="count" expression="0"/>
<output expression=""List of Customer(s) using the Service Provider " &spchk& " is/are: "" newline="True"/>
<for variable="i" start="0" end="s-1" direction="inc" step="1">
<if expression="(sepr[i]==spchk)">
<then>
<output expression=""Customer Name " &(i+1)& ": " &cusname[i]" newline="True"/>
<assign variable="count" expression="(count+1)"/>
</then>
<else/>
</if>
</for>
<if expression="(count==0)">
<then>
<output expression=""There are no customers with " &spchk& " as the Service Provider in the Directory!"" newline="True"/>
</then>
<else/>
</if>
</body>
</function>
</flowgorithm>