forked from MARIA-AZRAR/LMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLMS D.cpp
943 lines (794 loc) · 19.3 KB
/
LMS D.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
#include<iostream>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<fstream>
#include<cmath>
using namespace std;
int l=0;
int t=0;
//Bool functions//
bool isValidCourseCode(string code)
{
bool flag=false;
if(code.length()<=5)
{
for(int i=0;i<2;i++)
{
if((code[i]>='a')&&(code[i]<='z')||(code[i]>='A')&&(code[i]<='Z'))
flag=true;
else
flag=false;
}
for(int i=2;i<5;i++)
{
if((code[i]>='0')&&(code[i]<='9'))
flag=true;
else
flag=false;
}
}
else
flag=false;
return flag;
}
bool isValidCreditHours(int crdHrs)
{
bool flag=false;
if((crdHrs>0)&&(crdHrs<4))
{
flag=true;
}
else
{
flag=false;
}
return flag;
}
bool isValidSemester(int semester)
{
bool flag=false;
if(semester>=1 && semester<=8)
{
flag=true;
}
else
{
flag=false;
}
return flag;
}
bool isValidCourseName(string name)
{
string s=name;
bool flag=false;
if(name.length()<=50)
{
for(int i=0; i<name.length();i++)
{
if((name.at(i)>=65&&name.at(i)<=90)||(name.at(i)>=97 && name.at(i)<=122)||(name.at(i)== 32))
{
flag=true;
}
else
{
flag=false;
}
}
}
return flag;
}
bool saveCourse (string codeList[], string nameList[], int crtHrsList[], int semList[], int h)
{
bool flag=false;
ofstream outfile;
outfile.open("Courses.txt");
if(flag==false)
{
for(int i=0; i<l; i++)
{
outfile<<codeList[i]<<","<<nameList[i]<<","<<crtHrsList[i]<<","<<semList[i];
}
outfile<<endl;
l++;
}
else
flag==true;
outfile.close();
return flag;
}
bool does_file_exist(const char *filename)
{
ifstream infile(filename);
return infile.good();
}
bool isValidData(string arr[],string arr1[],string pas,string user, int s)
{
bool flag=true;
for (int i=0;i<s;i++)
{
if (arr[i]==user && arr1[i]==pas)
{
flag=false;
}
else
{
flag=true;
}
}
return flag;
}
bool isValidyear(string year)
{
bool flag=false;
if(year.length()>0 && year.length()<6)
{
flag=true;
}
else
{
flag=false;
}
return flag;
}
bool isValiddept(string disp)
{
bool flag=false;
for(int i=5;i<7;i++)
{
if((disp[i]>='a')||(disp[i]<='z')||(disp[i]>='A')||(disp[i]<='Z'))
{
flag=true;
}
else
{
flag=false;
}
}
return flag;
}
bool isValidroll_no(string rollno)
{
bool flag=false;
if(rollno.length()>0 && rollno.length()<300)
{
flag=true;
}
else
{
flag=false;
}
return flag;
}
bool isValidname(string name)
{
bool flag=false;
if(name.length()<=100)
{
for(int i=0;i<100;i++)
{
if((name[i]>='a') || (name[i]<='z') || (name[i]>='A') || (name[i]<='Z') || (name[i]=' '))
flag=true;
else
flag=false;
}
}
return flag;
}
bool saveStudents(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[], string courseCode[], string stdCourseList1[])
{
ofstream outfile;
outfile.open("Students.txt");
int k=2;
int j=1;
string Fnames[100];
bool flag=false;
bool valid_flag=false;
if(flag==false)
{
cout<<" Enter your full name please: ";
getline(cin,Fnames[k],' ');
getline(cin,Fnames[j]);
for( int i=1; i<l; i++)
{
while (valid_flag==false)
{
outfile<<regNo[i]<<"-"<<stdRegNoList[i]<<"-"<<courseCode[i]<<","<<Fnames[k]<<" "<<Fnames[j];
outfile<<stdCourseList1[i];
valid_flag=true;
}
}
outfile<<endl;
l++;
}
else
{
flag=true;
}
outfile.close();
return flag;
}
//***********************************************************************************************************************************//
//Void functions//
void AddCourse(string codeList[], string nameList[], int crtHrsList[], int semList[], int h)
{
string courseCode,courseName;
int crdHrs,semester;
bool t=false;
while(t==false)
{
cout<<" Enter details of course (For Example: CS101 3 1 Programming Fundamentals): ";
cin>>courseCode>>crdHrs>>semester;
getline(cin,courseName);
bool a=isValidCourseCode(courseCode);
bool x=isValidCreditHours(crdHrs);
bool y=isValidSemester(semester);
bool z=isValidCourseName(courseName);
if(a==true&&x==true&&y==true&&z==true)
{
codeList[l]=courseCode;
crtHrsList[l]=crdHrs;
nameList[l]=courseName;
semList[l]=semester;
t=true;
cout<<"\n Course has been added successfully."<<endl<<endl;
l++;
}
else
{
cout<<" Details you entered are not valid";
}
}
}
void EditCourse(string codeList[], string nameList[], int crtHrsList[], int semList[], int h)
{
string courseCode,courseName;
int crdHrs,semester;
bool t=false;
cout<<" Enter course code to edit: ";
cin>>courseCode;
while(t==false)
{
cout<<" Enter new details of the course: ";
cin>>courseCode>>crdHrs>>semester;
getline(cin,courseName);
bool a=isValidCourseCode(courseCode);
bool x=isValidCreditHours(crdHrs);
bool y=isValidSemester(semester);
bool z=isValidCourseName(courseName);
if(a==true&&x==true&&y==true&&z==true)
{
codeList[t]=courseCode;
crtHrsList[t]=crdHrs;
nameList[t]=courseName;
semList[t]=semester;
cout<<"\n Course has been edited successfully."<<endl<<endl;
t=true;
}
else
{
cout<<" Delails you entered are not valid."<<endl;
}
}
}
void DeleteCourse(string codeList[], string nameList[], int crtHrsList[], int semList[], int h)
{
string courseCode;
cout<<" Enter course code to delete: ";
cin>>courseCode;
int waste=0;
bool a=isValidCourseCode(courseCode);
if(a==true)
{
for(t=0;t<l;t++)
{
if(courseCode==codeList[t])
{
string valid=codeList[t];
codeList[t]=codeList[t+1];
codeList[t+1]=valid;
string valid1=nameList[t];
nameList[t]=nameList[t+1];
nameList[t+1]=valid1;
int valid3=semList[t];
semList[t]=semList[t+1];
semList[t+1]=valid3;
int valid4=crtHrsList[t];
crtHrsList[t]=crtHrsList[t+1];
crtHrsList[t+1]=valid4;
crtHrsList[t+1]='\0';
semList[t+1]='\0';
nameList[t+1]='\0';
codeList[t+1]='\0';
}
}
}
cout<<" Your course "<<courseCode<<" has been deleted."<<endl<<endl;
}
void ViewCourses(string codeList[], string nameList[], int crtHrsList[], int semList[], int h)
{
cout<<endl<<setw(5);
cout<<setw(15)<<"Course Code";
cout<<setw(15)<<"Course Name";
cout<<setw(15)<<"Credit Hours";
cout<<setw(11)<<"Semester";
for(int i=0; i<l; i++)
{
cout<<endl<<setw(5);
cout<<setw(15)<<codeList[i];
cout<<setw(15)<<nameList[i];
cout<<setw(15)<<crtHrsList[i];
cout<<setw(11)<<semList[i];
}
l++;
}
void ViewSemesterCourses(string codeList[], string nameList[], int crtHrsList[], int semList[], int h)
{
int semester;
cout<<" Enter the semester: ";
cin>>semester;
bool w=isValidSemester(semester);
if(w==true)
{
cout<<endl<<setw(5);
cout<<setw(15)<<"Course Code";
cout<<setw(15)<<"Course Name";
cout<<setw(15)<<"Credit Hours";
cout<<setw(11)<<"Semester"<<endl;
for (int i=0; i<h; i++)
{
if(semester==semList[i])
{
cout<<endl<<setw(5);
cout<<setw(15)<<codeList[i];
cout<<setw(15)<<nameList[i];
cout<<setw(15)<<crtHrsList[i];
cout<<setw(11)<<semList[i];
}
}
cout<<endl;
}
else
{
cout<<" Invalid input.\n";
}
}
void loadCourses(string codeList[],string nameList[],int crtHrs[],int semList[],ifstream &outfile, int i,int b, int &n)
{
n=0;
char ch;
for (int j=i;j<b && outfile!=0;j++)
{ getline(outfile,codeList[j],',');
getline(outfile,nameList[j],',');
outfile>>crtHrs[j]>>ch;
outfile>>semList[j];
n++;
}
}
void loadStudents(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[],ifstream &Students, int i,int b, int &n)
{
n=0;
char ch;
for (int j=i;j<b && Students!=0;j++)
{ getline(Students,stdNamesList[j],',');
getline(Students,stdRegNoList[j],',');
Students>>studentName[j]>>ch;
Students>>regNo[j];
n++;
}
}
void loadUsers(string arr[], string arr1[], ifstream &data, int &counter, int s)
{
counter=0;
for (int k=0; data!=0 && k<100; k++)
{
getline(data,arr[k],',');
getline(data,arr1[k]);
counter++;
}
}
void addStudent(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[], int h)
{
bool flag=false;
int j=0;
string name[100], year[10], dept[10], roll_no[10];
while(flag==false)
{
cout<<" Enter details of student (For Example: 2018-CS-22 Muhammad Abdullah): ";
{
getline(cin,year[j],'-');
getline(cin,dept[j],'-');
getline(cin,roll_no[j],' ');
getline(cin,name[j]);
string w=year[j];
string x=dept[j];
string y=roll_no[j];
string z=name[j];
bool a=isValidyear(w);
bool b=isValiddept(x);
bool c=isValidroll_no(y);
bool d=isValidname(z);
if(a==true && b==true && c==true && d==true)
{
regNo[l]=year[j];
stdNamesList[l]=dept[j];
stdRegNoList[l]=roll_no[j];
studentName[l]=name[j];
cout<<endl<<" Student has been added successfully."<<endl<<endl;
l++;
j++;
flag=true;
}
else
{
cout<<" Details you entered are not valid";
}
}
}
}
void updateStudent(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[])
{
bool flag=false;
int j=0;
string name[100], year[10], dept[10], roll_no[10], year1[10], dept1[10], roll_no1[10];
while(flag==false)
{
cout<<" Enter registration number of student to edit: ";
{
getline(cin,year1[l],'-');
getline(cin,dept1[l],'-');
getline(cin,roll_no1[l]);
cout<<" Enter new details of the student: ";
getline(cin,year[j],'-');
getline(cin,dept[j],'-');
getline(cin,roll_no[j],' ');
getline(cin,name[j]);
string w=name[j];
string x=year[j];
string y=dept[j];
string z=roll_no[j];
bool a=isValidyear(x);
bool b=isValiddept(y);
bool c=isValidroll_no(z);
bool d=isValidname(w);
if(a==true && b==true && c==true && d==true)
{
for(int i=0; i<l; i++)
{
if(year1[l]==regNo[i] && dept1[l]==stdNamesList[i] && roll_no1[l]==stdRegNoList[i])
{
regNo[i]=year[j];
stdNamesList[i]=dept[j];
stdRegNoList[i]=roll_no[j];
studentName[i]=name[j];
cout<<endl<<" Course has been edited successfully."<<endl<<endl<<endl;
flag=true;
}
else
{
cout<<" Details you entered are not valid"<<endl;
}
}
l++;
j++;
}
else
cout<<" Invalid data.";
}
}
}
void deletestudent(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[])
{
bool flag=false;
int j=0;
string name[100], year[10], dept[10], roll_no[10];
while(flag==false)
{
cout<<" Enter registration number of student to delete: ";
getline(cin,year[l],'-');
getline(cin,dept[l],'-');
getline(cin,roll_no[l]);
bool a=isValidyear(year[l]);
bool b=isValiddept(dept[l]);
bool c=isValidroll_no(roll_no[l]);
if(a==true && b==true && c==true)
{
for(int t=0;t<=l;t++)
{
if(year[l]==regNo[t] && dept[l]==stdNamesList[t] && roll_no[l]==stdRegNoList[t])
{
string valid=regNo[t];
regNo[t]=regNo[t+1];
regNo[t+1]=valid;
string valid1=stdNamesList[t];
stdNamesList[t]=stdNamesList[t+1];
stdNamesList[t+1]=valid1;
string valid3=stdRegNoList[t];
stdRegNoList[t]=stdRegNoList[t+1];
stdRegNoList[t+1]=valid3;
string valid4=studentName[t];
studentName[t]=studentName[t+1];
studentName[t+1]=valid4;
regNo[t+1]='\0';
stdNamesList[t+1]='\0';
stdRegNoList[t+1]='\0';
studentName[t+1]='\0';
cout<<" Student of registration number "<<year[l]<<"-"<<dept[l]<<"-"<<roll_no[l]<<" has been deleted."<<endl<<endl;
l++;
}
else
{
cout<<" Registration number you entered is not available.";
}
}
}
else
{
cout<<" Details you entered are not valid\n";
}
flag=true;
}
}
void Viewstudents(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[])
{
cout<<endl<<setw(5);
cout<<setw(15)<<"Session";
cout<<setw(15)<<"Department";
cout<<setw(15)<<"Roll Number";
cout<<setw(11)<<"Name";
for(int i=0; i<l; i++)
{
cout<<endl<<setw(5);
cout<<setw(15)<<regNo[i];
cout<<setw(15)<<stdNamesList[i];
cout<<setw(15)<<stdRegNoList[i];
cout<<setw(13)<<studentName[i];
}
l++;
cout<<endl;
}
void registerCourse(string stdRegNoList1[], string stdCourseList1[], string courseCodeList1[], string stdNamesList1[], string regNo1[], string courseCode1[])
{
string name1[100], year1[10], dept1[10], roll_no1[10];
string coursecode;
cout<<" Enter registration number of student for course registration: ";
getline(cin,year1[l],'-');
getline(cin,dept1[l],'-');
getline(cin,roll_no1[l]);
string w=year1[l];
string x=dept1[l];
string y=roll_no1[l];
bool a=isValidyear(w);
bool b=isValiddept(x);
bool c=isValidroll_no(y);
if(a==true && b==true && c==true)
{
regNo1[l]=year1[l];
stdNamesList1[l]=dept1[l];
stdRegNoList1[l]=roll_no1[l];
cout<<" Enter course code to register: ";
cin>>coursecode;
bool a=isValidCourseCode(coursecode);
if(a==true)
{
stdCourseList1[l]=coursecode;
cout<<"\n Course has been registered for student.";
}
else
{
cout<<"\n Invalid data.";
}
l++;
}
}
void unRegisterCourse(string stdNamesList[], string stdRegNoList[], string studentName[], string regNo[], string coursecode[])
{
bool flag=false;
int j=0;
string courseCode;
string name[100], year[10], dept[10], roll_no[10];
while(flag==false)
{
cout<<" Enter registration number of student: ";
getline(cin,year[l],'-');
getline(cin,dept[l],'-');
getline(cin,roll_no[l]);
bool a=isValidyear(year[l]);
bool b=isValiddept(dept[l]);
bool c=isValidroll_no(roll_no[l]);
if(a==true && b==true && c==true)
{
regNo[l]=year[l];
stdNamesList[l]=dept[l];
stdRegNoList[l]=roll_no[l];
cout<<" Enter Course Code to unregister: ";
cin>>courseCode;
if(isValidCourseCode(courseCode)==true)
{
coursecode[l]=courseCode;
for(int t=0;t<l;t++)
{
if(year[l]==regNo[t] && dept[l]==stdNamesList[t] && roll_no[l]==stdRegNoList[t])
{
if(coursecode[j]==coursecode[t])
{
coursecode[t]='\0';
cout<<" Course code of registration number "<<year[l]<<"-"<<dept[l]<<"-"<<roll_no[l]<<" is unregistered."<<endl<<endl;
l++;
}
else
{
cout<<" Course Code you entered is not registered by student.\n";
}
}
else
{
cout<<" Details you entered are not valid\n";
}
flag=true;
}
}
}
}
}
int main()
{
string passwordList[100];
ifstream myfile;
ifstream store;
string username,password;
string stdNamesList[60], stdRegNoList[60], studentName[60], regNo[200], stdCourseList[100], courseCodeList[100], courseCode[100], stdCourseList1[100];
string codeList[100], nameList[100], emailList[100];
int n, n1, crtHrsList[100], semList[100];
string coursecode, course;
int crdHrs, semester, repeat, Name, i, b;
ifstream outfile;
ifstream Students;
loadCourses (codeList, nameList, crtHrsList, semList, outfile, n, i, b);
loadStudents(stdNamesList, stdRegNoList, studentName, regNo, Students, n, i, b);
bool file = does_file_exist("Courses.txt");
bool file1 = does_file_exist("Students.txt");
if(file && file1)
{
loadUsers(emailList,passwordList,myfile,n1,100);
cout<<""<<" **"<<"Welcome to university of Engineering and Technolohgy"<<""<<"**"<<endl;
cout<<"Dear user current software is intended for authorized users only."<<endl;
cout<<"Login to the system to get access"<<endl<<endl;
cout<<"Username: ";
cin>>username;
cout<<"Password: ";
cin>>password;
cout<<endl;
cout<<"Your Username:"<<username<<endl;
cout<<"Your Password:"<<password<<endl<<endl;
bool data=isValidData(emailList,passwordList,password,username,n1);
while (!data)
{
cout<<endl<<""<<" **"<<"Welcome to university of Engineering and Technolohgy"<<"**"<<""<<endl;
cout<<"Dear user current software is intended for authorized users only"<<endl;
cout<<"your email/password is not correct Login again to the system to get access"<<endl;
cout<<"Enter username:";
cin>>username;
cout<<"Enter password :";
cin>>password;
cout<<"\nDear user,username/password is incorrect.Again enter username/password to login access the system"<<endl;
cout<<"Password:"<<password<<endl;
cout<<"Username:"<<username<<endl;
data=isValidData(emailList,passwordList,password,username,n1);
}
if(data==true)
{
while(n!=6)
{
for(i=0;i<5;i++)
{
cout<<"You have successfully logged into the system"<<endl;
cout<<" Choose the following option"<<endl;
cout<<" 1\tAdd course"<<endl;
cout<<" 2\tUpdate course"<<endl;
cout<<" 3\tDelete course"<<endl;
cout<<" 4\tView all course"<<endl;
cout<<" 5\tView course of a semester"<<endl;
cout<<" 6\tAdd new student"<<endl;
cout<<" 7\tUpdate Student"<<endl;
cout<<" 8\tDelete Student"<<endl;
cout<<" 9\tView all Student"<<endl;
cout<<" 10\tRegister the course for Student"<<endl;
cout<<" 11\tUnregister the course for Student"<<endl;
cout<<" 12\tLogout of the system"<<endl;
cout<<" 13\tExit program"<<endl;
while(n!=13)
{
cout<<"\n Choose option: ";
cin>>n;
if(n>=1 && n<=13)
{
if(n==1)
{
AddCourse(codeList,nameList,crtHrsList,semList, repeat);
repeat++;
}
else if(n==2)
{
EditCourse(codeList,nameList,crtHrsList,semList,repeat);
repeat++;
}
else if(n==3)
{
DeleteCourse(codeList, nameList, crtHrsList, semList, repeat);
repeat++;
}
else if(n==4)
{
ViewCourses(codeList, nameList, crtHrsList, semList, repeat);
repeat++;
}
else if(n==5)
{
ViewSemesterCourses(codeList, nameList,crtHrsList, semList, repeat);
repeat++;
}
else if(n==6)
{
addStudent(stdNamesList, stdRegNoList, studentName, regNo, repeat);
repeat++;
}
else if(n==7)
{
updateStudent(stdNamesList, stdRegNoList, studentName, regNo);
}
else if(n==8)
{
deletestudent(stdNamesList, stdRegNoList, studentName, regNo);
}
else if(n==9)
{
Viewstudents(stdNamesList, stdRegNoList, studentName, regNo);
}
else if(n==10)
{
registerCourse(stdRegNoList, stdCourseList, courseCodeList, stdNamesList, regNo, courseCode);
}
else if(n==11)
{
unRegisterCourse(stdNamesList, stdRegNoList, studentName, regNo, courseCode);
}
else if(n==12)
{
cout<<" Logged out!";
return 0;
}
else if(n==13)
{
saveCourse(codeList, nameList, crtHrsList, semList, repeat);
saveStudents(stdRegNoList, stdNamesList, courseCode, regNo, stdRegNoList, stdCourseList1);
cout<<"\n File saved successfully.";
cout<<"\n Program is closed.";
return 0;
}
else
{
cout<<" Invalid input. Access your program again.\n";
return 0;
}
}
else
{
cout<<"\n Invalid input. Access your program again.";
return 0;
}
}
}
}
}
else
{
cout<<"You entered wrong data.";
}
}
else
{
cout<<"We are unable to run programe because data does not exist"<<endl;
}
return 0;
}