-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLMS.cpp
1126 lines (897 loc) · 20.7 KB
/
LMS.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
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
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <iostream>
#include <stdio.h>
#include <cctype>
#include <string>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <cctype>
#include <sstream>
using namespace std;
int COUNTERLOOPTIME=0;
ofstream OUTFILE;
ifstream INFILE;
string users,passwords;
string User_List, password_List,Name_List;
string codi;
bool check= false ;
int f=-1;
int BB=0;
string BIYA[10][50];
int index1,index,result;
////////////////////STRUCT///////////////////////
struct CourseType{
string code[50];
int Sem[50];
int CrdHrs[50];
string name[50];
};
//////*************************///////////////////////
// first function//
bool isValidCourseCode(string code)
{
bool flag=false;
int size=code.size();
if(size==5)
{
if(code[0] >=65 && code[0]<=90)
{
if(code[1]>=65 && code[1]<=90)
{
if(code[2]>=48 && code[2]<=57)
{
if(code[3]>=48 && code[3]<=57)
{
if(code[4]>=48 && code[4]<=57)
{
flag=true;
}
}
}
}
}
}
return flag;
}
//2nd function
bool isValidCourseName(string name)
{
bool courseIsValid;
for (int i = 0; i < name.size(); i++)
{
if ((name[i]>='a'&&name[i]<='z')||(name[i]>='A'&&name[i]<='Z') ||name[i]==' ')
{
courseIsValid=true;
}
else
{
courseIsValid = false;
}
}
return courseIsValid;
}
//3rd function
bool ValidCreditHours(int hour)
{
bool valid=true;
if(hour==1|| hour==2 || hour==3 )
{
}
else {
bool valid=false;
}
return ValidCreditHours;
}
//search array index//
// This function searchs n in the array and returns 1 if element exists within array and -1 if it doesn't.
int searchInArray(string code , string codelist[])
{
int index= -1;
for (int i = 0; i <COUNTERLOOPTIME; i++)
{
if (codelist[i] == code)
{
index=i;
}
}
return index;
}
//search array index//
// This function searchs n in the array and returns 1 if element exists within array and -1 if it doesn't.
int searchArray(string regNo , string stdRegNoList[])
{
int index= -1;
for (int i = 0; i <1000; i++)
{
if (stdRegNoList[i] == regNo)
{
index=i;
}
}
return index;
}
///////// search in arrrays for students log-in//////////
int searchInnArray(string passwords , string stdNameList[],string regNo, string stdRegNoList[])
{
int index= -1;
for (int i = 0; i <1000; i++)
{
if (stdNameList[i] == passwords&&stdRegNoList[i] == regNo)
{
index=i;
}
}
return index;
}
////////////search in struct array//
int searchInnnArray(string regNo, string stdRegNoList[])
{
int index= -1;
for (int i = 0; i <1000; i++)
{
if (stdRegNoList[i] == regNo)
{
index=i;
}
}
return index;
}
//4th function
bool isValidSemester(int Sem)
{
bool valid;
if(Sem==1|| Sem==2 || Sem==3 || Sem==4 ||Sem==4 ||Sem==5 || Sem==6 ||Sem==7 ||Sem==8)
{
valid=true;
}
else
{
valid=false;
}
return valid;
}
// valid reg no //
bool isValidRegistrationNumber(string regNo)
{
bool flag=false;
int size=regNo.size();
if(size==11)
{
if(regNo[0] >=48 && regNo[0]<=57)
{
if(regNo[1]>=48 && regNo[1]<=57)
{
if(regNo[2]>=48 && regNo[2]<=57)
{
if(regNo[3]>=48 && regNo[3]<=57)
{
if(regNo[4]='-')
{
if(regNo[5]>=65 && regNo[5]<=90)
{
if(regNo[6]>=65 && regNo[6]<=90)
{
if(regNo[7]='-')
{
if(regNo[8] >=48 && regNo[8]<=57)
{
if(regNo[9] >=48 && regNo[9]<=57)
{
if(regNo[10] >=48 && regNo[10]<=57)
{
flag=true;
}
}
}
}
}
}
}
}
}
}
}
}
return flag;
}
/// valid name //
bool isValidStudentName(string StudentName)
{
bool courseIsValid;
for (int i = 0; i < StudentName.size(); i++)
{
if ((StudentName[i]>='a'&&StudentName[i]<='z')||(StudentName[i]>='A'&&StudentName[i]<='Z') ||StudentName[i]==' ')
{
courseIsValid=true;
}
else
{
courseIsValid = false;
}
}
return courseIsValid;
}
//ADD course?//
void AddCourse(string codelist[],string namelist[],int crtHrsList[],int semiList[],string code,string name, int hour,int Sem)
{
int i=COUNTERLOOPTIME;
if(isValidCourseCode(code)==true)
{
codelist[i]=code;
if(isValidCourseName(name)==true)
{
namelist[i]=name;
if(ValidCreditHours(hour)==true)
{
namelist[i]=hour;
if(isValidSemester(Sem)==true)
{
codelist[i]=code;
crtHrsList[i]=hour;
semiList[i]=Sem;
namelist[i]=name;
COUNTERLOOPTIME++;
}
else
{
cout<<"Semester not valid !";
}
}
else
{
cout<<"Credit Hour not valid !";
}
}
else
{
cout<<"Course Name not valid !";
}
}
else
{
cout<<"Course Code not valid !";
}
}
// edit course //
void EditCourse(string codelist[],string namelist[],int crtHrsList[],int semiList[],string code,string name, int hour,int Sem, int index)
{
int i;
if(isValidCourseCode(code)==1)
{
if(isValidCourseName(name)==1)
{
if(ValidCreditHours(hour)==1)
{
if(isValidSemester(Sem)==1)
{
codelist[index]=code;
namelist[index]=name;
namelist[index]=hour;
semiList[index]=Sem;
}
}
}
}
}
// delete course//
void DeleteCourse(string codelist[],string namelist[],int crtHrsList[],int semiList[],string code,string name, int hour,int Sem , int index)
{
for(int i=index ; i<=COUNTERLOOPTIME; i++ )
{
codelist[i]=codelist[i+1];
namelist[i]=namelist[i+1];
namelist[i]=namelist[i+1];
semiList[i]=semiList[i+1];
}
COUNTERLOOPTIME=COUNTERLOOPTIME-1;
}
// Veiw Course //
void VeiwAllCourse(string codelist[],string namelist[],int crtHrsList[],int semiList[])
{
for( int i=0 ; i<COUNTERLOOPTIME ; i++)
{
cout<<codelist[i]<<setw(20)<<namelist[i]<<setw(17)<<crtHrsList[i]<<setw(15)<<semiList[i]<<endl;
}
}
// veiw courses of semester//
void VeiwSemesterCourses(string codelist[],string namelist[],int crtHrsList[],int semiList[],int Sem)
{
string len;
int j=0;
// array for storing the indeces of the matching semester.
int ans_index[COUNTERLOOPTIME];
for(int i=0;i<COUNTERLOOPTIME;i++)
{
if(semiList[i]==Sem)
{
ans_index[j]=i;
j++;
}
}
for( int i=0 ;i<j;i++)
{
int index=ans_index[i];
cout<<codelist[index]<<setw(25)<<namelist[index]<<setw(15)<<crtHrsList[index]<<endl;
}
}
// save courses//
bool saveCourses(string codelist[],int semiList[],int crtHrsList[],string namelist[])
{
bool flag;
if( COUNTERLOOPTIME > 0 )
{
for ( int i = 0; i < COUNTERLOOPTIME ; i++)
{
OUTFILE<<codelist[i]<<" "<<semiList[i]<<" "<<crtHrsList[i]<<" "<<namelist[i]<<endl;
flag = true;
}
}
else {
flag= false;
}
return flag;
}
//load courses//
bool loadCourses(string codelist[],string namelist[],int crtHrsList[],int semiList[])
{ bool flag;
INFILE.open("Courses.txt");
if(INFILE.is_open() )
{
cout<<"Courses file exist "<<endl;
flag=true;
}
else
{
cout<<"file doesnot exist "<<endl;
flag=false;
}
if(flag==1)
{
for ( int i = 0; i < COUNTERLOOPTIME ; i++)
{
string someString;
while(getline(INFILE, someString)){
int i = 0;
string courseName, courseCode;
int semesterNum, creditHours;
while(someString[i] != ','){
courseCode += someString[i];
i++;
}
i++;
while(someString[i] != ','){
courseName += someString[i];
i++;
}
i++;
creditHours = someString[i];
i++;
semesterNum = someString[i];
codelist[COUNTERLOOPTIME] = courseCode;
namelist[COUNTERLOOPTIME] = courseName;
semiList[COUNTERLOOPTIME] = semesterNum;
crtHrsList[COUNTERLOOPTIME] = creditHours;
} COUNTERLOOPTIME++;
}
}
return flag;
}
//user's load //
bool loadUsers(string usersList[] , string passwordsList[])
{
int i=0;
bool flag=false;
INFILE.open("Users.txt");
if(INFILE.is_open())
{
string LINE[1000];
while(getline(INFILE,LINE[i]))
{
stringstream ss (LINE[i]);
getline( ss , User_List , ',');
getline( ss , password_List , ',');
usersList[i] =User_List;
passwordsList[i] =password_List;
i++;
}
flag= true;
}
else {
flag =false;
}
return flag;
}
///bool login//
bool login(string usersList[],string passwordsList[] )
{
for (int i=0 ; i<3 ; i++)
{
if( usersList[i]==users && passwordsList[i]==passwords)
{
check=true;
}
}
return check;
}
///bool login//
bool loginG(string stdRegNoList[],string stdNamesList[] )
{
for (int i=0 ; i<1000; i++)
{
if( stdRegNoList[i]==users && stdNamesList[i]==passwords)
{
check=true;
}
}
return check;
}
//******************************************// part 3 //****************************************//
//ADD STUDENT //
void AddStudent (string stdNamesList[] , string stdRegNoList[], string StudentName, string regNo)
{
f++;;
for( f ;f<COUNTERLOOPTIME ; ){
stdNamesList[f]=StudentName;
stdRegNoList[f]=regNo;
cout<<f;
cout<<" Student is Added Sucesssfully "<<endl;
break;
}
}
// UPDATE STUDENT //
void updateStudent(string stdNamesList[] , string stdRegNoList[], string StudentName, string regNo ,int index)
{
stdNamesList[index]=StudentName;
stdRegNoList[index]=regNo;
cout<<" Student is Added Sucesssfully "<<endl;
}
// delete Student //
void DeleteStudent(string stdNamesList[] , string stdRegNoList[],CourseType stdCourseList[],string regNo,int index)
{
char f='\0';
stdNamesList[index]=f;
stdRegNoList[index]=f;
COUNTERLOOPTIME=COUNTERLOOPTIME-1;
}
// VEIW ALL STUDENTS //
void VeiwAllStudents(string stdRegNoList[],string stdNamesList[])
{
for( int i=0 ; i<10 ; i++)
{
cout<<stdRegNoList[i]<<setw(20)<<stdNamesList[i]<<endl;
}
}
// register course//
void registerCourse(string stdRegNoList[], CourseType stdCourseList[], string codelist[], string regNo ,string code,int index,int index1)
{
stdRegNoList[index]=regNo;
codelist[index1]=code;
for( int L ;L<50 ;)
{
stdCourseList[index].code[L]=code;
L++;
break;
}
}
///// course list
int searchInArray(string code , CourseType stdCourseList[])
{
int index1= -1;
for (int i = 0; i <COUNTERLOOPTIME; i++)
{
if ( stdCourseList[i].code[i] == code)
{
index1=i;
}
}
return index;
}
// unregistre course //
void unRegisterCourse(string stdRegNoList[], CourseType stdCourseList[], string regNo ,string code,int index,int index1)
{
stdRegNoList[index]=regNo;
stdCourseList[index].code[index1]='\0';
}
/////Save Student //
void saveStudents(string stdRegNoList[], string stdNamesList[],CourseType stdCourseList[])
{ OUTFILE.open("Students.txt");
if (OUTFILE.is_open())
{
for( int f=0 ; f < 1000 ; )
{
if (stdRegNoList[f]!="\0"){
OUTFILE<<stdRegNoList[f]<<","<<stdNamesList[f]<<endl;
for ( int L=0 ; L<50 ;L++)
{
if(stdCourseList[f].code[L]!="\0")
{
OUTFILE<<stdCourseList[f].code[L]<<",";
}
}
OUTFILE<<endl;
}
f++;
}
}
OUTFILE.close();
}
///////////load students//
bool LoadStudents(string stdRegNoList[], string stdNamesList[],CourseType stdCourseList[])
{ ifstream INFILE;
string regNo,codes[50],Name;
int i=0;
bool flag=false;
INFILE.open("Students.txt");
if(INFILE.is_open())
{
flag=true;
string LINE[1000];
while(getline(INFILE,LINE[i]))
{ stringstream ss (LINE[i]);
getline( ss , regNo , ',');
getline( ss , Name , ',');
stdRegNoList[i]= regNo;
stdNamesList[i]=Name;
for(int j=0; j<50 ;j++)
{
getline( ss ,codi,',');
stdCourseList[i].code[j]=codi;
}
i++;
}
}
return flag;
}
// veiw registered courses//
void VeiwregisterCourse(string regNo, string stdRegNoList[], CourseType stdCourseList[],int result)
{
int index= -1;
for (int i = 0; i <1000; i++)
{
if (stdRegNoList[i] == regNo)
{
index=i;
if(index==result){
for( int L=0 ;L<50 ;L++)
{
cout << stdCourseList[i].code[L];
}
}else{cout<<"try agian";
}
}
}
}
int main()
{
string codelist[1000]="",namelist[1000]="";
string code,name;
int crtHrsList[1000],semiList[1000];
int hour,Sem;
string usersList[1000] , passwordsList[1000];
int A;
string stdRegNoList[1000];
string stdNamesList[1000];
string StudentName;
string regNo;
CourseType stdCourseList[1000];
LoadStudents(stdRegNoList, stdNamesList,stdCourseList);
cout<<"choose the option for log in"<<endl;
cout<<"1"<<" for admin"<<endl;
cout<<"2"<<" for student"<<endl;
cout<<"Enter Option ";
int opt;
cin>>opt;
if(opt==1)
{
int result = loadUsers(usersList , passwordsList);
if(result !=-1)
{
Label :
cout<<"\n **Welcome to University learning management system**"<<endl;
cout<<"//****************uet*************//"<<endl<<endl<<endl;
cout<<"Dear User, current software is intended for authorized users only"<<endl<<endl;
cout<<"Login to the system to get access.";
cout<<endl;
do{
do{
cout<<"Username: ";
cin>>users;
cout<<endl;
cout<<"Password: ";
cin>>passwords;
login(usersList , passwordsList);
}while(check!=true);
if ( check ==true)
{
cout<<"1"<<" "<<"ADD Course"<<endl;
cout<<"2"<<" "<<"Update Course"<<endl;
cout<<"3"<<" "<<"Delete Course"<<endl;
cout<<"4"<<" "<<"Veiw All Course"<<endl;
cout<<"5"<<" "<<"Veiw Courses Of Semester"<<endl;
cout<<"6"<<" "<<"Add Student"<<endl;
cout<<"7"<<" "<<"Undate Student"<<endl;
cout<<"8"<<" "<<"Delete Student"<<endl;
cout<<"9"<<" "<<"Veiw all students"<<endl;
cout<<"10"<<" "<<"Register Course for student "<<endl;
cout<<"11"<<" "<<"Unregister Course"<<endl;
cout<<"12"<<" "<<" logout "<<endl;
cout<<"13"<<" "<<"Exit Program"<<endl;
cout<<endl;
loadCourses(codelist, namelist, crtHrsList, semiList);
do
{
cout<<"choose ONE of the following option : ";
cin>>A;
if(A==1)
{
cout<<""""""""""""""""""""""""""""""""<<endl;
cout<<"\nEnter details to add course : ";
cout<<""""""""""""""""""""""""""""""""<<endl;
cout<<endl;
cout<<"enter Course Code, Semester, Credit Hour, Enter course name ";
cout<<endl;
cin>>code;
cout<<endl;
cin>>Sem;
cout<<endl;
cin>>hour;
cout<<endl;
getline(cin,name);
AddCourse(codelist, namelist, crtHrsList, semiList, code, name, hour, Sem);
cout<<"Course is ADDED successfully ";
cout<<endl;
cout<<endl;
}
else if(A==2)
{
cout<<"Enter the Course Code you Want to Change"<<endl;
cin>>code;
int result = searchInArray(code,codelist);
cout<<endl;
if (result != -1)
{
cout<<"Enter the details of new COURSE"<<endl;
cin>>code;
getline(cin,name);
cin>>hour>>Sem;
EditCourse(codelist, namelist, crtHrsList, semiList, code, name, hour, Sem , result);
cout<<"Course has been changed sucessfully";
cout<<endl;
cout<<endl;
}
else
{
cout<<"Code Does not Exist in the codelist"<<endl<<endl;
}
}
else if(A==3)
{
cout<<"Enter Course Code you want to delete "<<endl;
cin>>code;
int result = searchInArray(code,codelist);
if (result!= -1)
{
DeleteCourse(codelist, namelist, crtHrsList, semiList, code, name, hour, Sem, result);
cout<<"Course has been deleted";
cout<<endl;
}
else
{
cout<<"Course Code does not exist ";
}
}
else if (A==4)
{
cout<<"All courses are as follow : "<<endl;
cout << "Course Code" <<setw(15)<<"Name"<<setw(20)<<"CrtHours"<<setw(15)<<"semester"<<endl;
VeiwAllCourse(codelist, namelist, crtHrsList, semiList );
cout<<endl;
}
else if(A==5)
{
cout <<"Enter the semester number : "<<endl;
cin>>Sem;
if(isValidSemester(Sem)==1)
{
cout << "Course Code" <<setw(18)<<"Name"<<setw(20)<<"CrtHours"<<endl;
VeiwSemesterCourses(codelist, namelist, crtHrsList, semiList, Sem);
cout<<endl;
}
else
{
cout<<"Semester not Valid : "<<endl;
}
}
else if(A==6)
{
COUNTERLOOPTIME++;
cout<<"registration number will be as follow e.g 2018-CS-211 or 2018-CS-001";
cout<<endl;
cout<<endl;
cout<<"Enter the reggistration no "<<endl;
cin >> regNo;
int r=isValidRegistrationNumber(regNo);
if (r==true){
cout << "Enter the Student Name "<<endl;
cin>>StudentName;
AddStudent (stdNamesList ,stdRegNoList,StudentName, regNo) ;
}
else{
cout<<"please enter valid registration no "<<endl;
}
}
else if (A==7)
{
cout<<"Enter the Student name you Want to Change"<<endl;
cin >> StudentName;
int result = searchArray(StudentName,stdNamesList);
cout<<endl;
if (result != -1)
{
cout<<"Enter the name and registration no of new student "<<endl;
cout<<endl;
cout<<endl;
cout<<"Enter the reggistration no "<<endl;
cin >> regNo;
int r=isValidRegistrationNumber(regNo);
if (r==true){
cout << "Enter the Student Name "<<endl;
cin >> StudentName;
updateStudent( stdNamesList , stdRegNoList,StudentName, regNo , result);
}
else{
cout<<"please enter valid registration no "<<endl;
}
}
else {
cout<<"student doesnot exist "<<endl;
}
}
else if(A==8)
{
cout<<"Enter Student's Registration you want to delete "<<endl;
cin>>regNo;
int r=isValidRegistrationNumber(regNo);
if (r==true){
int result = searchArray(regNo,stdRegNoList);
if (result!= -1)
{
DeleteStudent(stdNamesList,stdRegNoList, stdCourseList ,regNo,result);
cout<<"student has been deleted";
cout<<endl;
}
else
{
cout<<"student does not exist ";
}
}
else{
cout<<"please enter valid registration no "<<endl;
}
}
else if(A==9)
{
cout<<"Following are the Students : "<<endl;
int f=0;
cout << "Reg. no " <<setw(20)<<"Name"<<endl;
VeiwAllStudents(stdRegNoList, stdNamesList);
cout<<endl;
f++;
}
else if (A==10)
{
cout<<endl;
cout<<"Enter registration Number of the student for course registration:"<<endl;
cout<<endl;
cout<<"registration number will be as follow e.g 2018-CS-211 or 2018-CS-001";
cout<<endl;
cin>>regNo;
int resultTT=isValidRegistrationNumber(regNo);
if ( resultTT ==true)
{
int result = searchArray(regNo,stdRegNoList);
if (result!= -1)
{ cout<<"Enter the Course Code you Want to register"<<endl;
cin>>code;
int result1 = searchInArray(code,codelist);
if (result1!= -1){
registerCourse(stdRegNoList, stdCourseList, codelist, regNo, code,result,result1);