-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudentEnrolCourse.cpp
2483 lines (2100 loc) · 58.1 KB
/
StudentEnrolCourse.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 <stdlib.h>
#include <time.h>
#include <string>
#include <string.h>
#include <fstream>
#include <iomanip>
using namespace std;
//All function declaration
void clearScreen();
bool isUsernameUnique(string username);
int genVerificationCode();
void sendCodeByEmail(int verificationCode);
void createAccount();
void wellcomeScreen();
int loginMenuScreen();
void displayGoodByeMessage();
void displayMainAdminMenu(string username);
void displayTeacherMenu(string username);
void displayStudentMenu(string username);
void gotoMainMenu(string usertype,string username);
bool displayVerificationScreen();
void signIn();
int getAge(string dob);
void selectCourse(string username);
bool isCourseAlreadySelected(string c_code,string username);
bool isMaxSelCourseReached(string username);
bool isCourseAlreadyEnrolled(string c_code,string username);
void applyCourseSelection(string username,string c_code);
void applyCourseEnrollment(string username,string c_code);
int getSum(int array_courses[],int index);
void EnrollRequests(string username);
bool isMaxEnrolCourseReached(string username);
void ViewEnrolCourseList(string username);
void ViewSelectedCourseList(string username);
void ViewAssignedTeacherToCourse(string userame);
void ViewEnrolStudentInCourse(string userame);
string FindAssignedTeacherForCourse(string ccode);
void PrintTeacherDetail(string unique_id);
void PrintStudentDetail(string *unique_ids,int index);
string* FindEnrolStdInCourse(string ccode,int &index);
void CourseEnrolRequest();
void CourseAssignRequest();
int main()
{
//required variables
int login_choice;
// Use current time as
// seed for random generator
srand(time(0));
//iterate until user wish to exist the program
do
{
//Calling login menu screen
login_choice = loginMenuScreen();
switch(login_choice)
{
//case 1 is login
case 1:
//Calling signIn()
signIn();
break;
//case 2 is create account
case 2:
//Calling createAccount()
createAccount();
break;
//case 3 is terminate program
case 3:
//Calling displayGoodByeMessage
displayGoodByeMessage();
break;
}
}while(login_choice!=3);
cout<<"\t";
system("pause");
return 0;
}
//Function Declaration
//Display the Login screen Menu
//prompt the user to enter the choice
//return the user choice
int loginMenuScreen()
{
//variable to hold the user entered choice
int choice;
//do while loop to keep on receiving user choice
//until valid choice is entered
do
{
//Calling clearScreen()
clearScreen();
//Calling wellcomeScreen() function
wellcomeScreen();
//display the login screen menu
cout<<"\n\tSelect from following options:\n";
cout<<"\t\t1.\tLogin"<<endl
<<"\t\t2.\tCreate New Account"<<endl
<<"\t\t3.\tExit"<<endl;
//prompt for the user choice
cout<<"\tEnter your choice (1,2,3):\t";
//input value from user
cin>>choice;
}while(!(choice==1 || choice ==2 || choice ==3));
//return user choice
return choice;
}
//function to clear previous screen content
void clearScreen()
{
system("cls");
}
// Display the wellcome message
// with the title of the program
void wellcomeScreen()
{
cout<<"\n\t*********************************************************";
cout<<"\n\t*** Wellcome to the Student Course Enrollment Program ***";
cout<<"\n\t*********************************************************"<<endl<<endl;
}
//Display good bye message
void displayGoodByeMessage()
{
cout<<"\n\t**********************************************************"
<<"\n\t*** Thanks for using Student Course Enrollment Program ***"
<<"\n\t**********************************************************\n";
}
//function that will prompt for the basic user information
//save it to the file named Users
//generate 3 digit verification code
//save the verification code to the file named Email
void createAccount()
{
//required arrays to hold user details from file
string arr_fname[100],arr_lname[100],arr_dob[100],arr_contactno[100],arr_username[100],arr_password[100],arr_usertype[100];
int numOfUsers=0;
int num_dob =0;
//required variables to hold the values entered by the user
string usr_fname,usr_lname;
string username,password;
string dob,contact_num;
string usr_type;
int verification_code;
char confirmation;
bool ageValid=false;
//Calling clearScreen()
clearScreen();
//Read all user details from file to array
//ifstream class object
ifstream userfileread("Users.txt");
//check if file opens
if(userfileread.is_open())
{
while(!userfileread.eof())
{
//read till the end of the file
userfileread>>arr_fname[numOfUsers];
userfileread>>arr_lname[numOfUsers];
userfileread>>arr_dob[numOfUsers];
userfileread>>arr_contactno[numOfUsers];
userfileread>>arr_usertype[numOfUsers];
userfileread>>arr_username[numOfUsers];
userfileread>>arr_password[numOfUsers];
numOfUsers++;
}
numOfUsers--;
userfileread.close();
}
//Display the title
cout<<"\n\t**************************"
<<"\n\t*** Create new Account ***"
<<"\n\t**************************\n"<<endl;
cout<<"\tEnter user type (A for Admin, T for Teacher, S for Student) :";
cin>>usr_type;
if(usr_type=="A")
{
usr_type="Admin";
}
else if(usr_type=="T")
{
usr_type="Teacher";
}
else if(usr_type=="S")
{
usr_type="Student";
}
//prompt for the user basic information
cout<<"\tEnter first name :";
cin>>usr_fname;
cout<<"\tEnter last name :";
cin>>usr_lname;
//loop to check if the username is unique
do
{
cout<<"\tEnter Unique ID :";
cin>>username;
}while(!isUsernameUnique(username));
cout<<"\tEnter password :";
cin>>password;
//loop to check the age below 67 if user type is teacher
if(usr_type=="Teacher")
{
do
{
cout<<"\tEnter dob (dd/mm/yyyy):";
cin>>dob;
//convert string to number
num_dob = getAge(dob);
if(2018-num_dob<67)
{
ageValid=true;
break;
}
else
{
cout<<"\n\tYou are over aged..."<<endl<<"\t";
ageValid=false;
system("pause");
return ;
}
}while(!ageValid);
}
else
{
cout<<"\tEnter dob (dd/mm/yyyy):";
cin>>dob;
}
cout<<"\tEnter contact No :";
cin>>contact_num;
cout<<"\n\tAre you sure to proceed with creating account (Y/N):";
cin>>confirmation;
//check if user want to create account
if(confirmation=='y' || confirmation=='Y')
{
//Reading previous data to the arrays
//saving user information into the file name Users.txts
//ofstream class object
ofstream userfile("Users.txt");
//check if file is opened successfully
if(userfile.is_open())
{
//Write previous data to the file
for(int i=0;i<numOfUsers;i++)
{
userfile<<arr_fname[i]<<endl;
userfile<<arr_lname[i]<<endl;
userfile<<arr_dob[i]<<endl;
userfile<<arr_contactno[i]<<endl;
userfile<<arr_usertype[i]<<endl;
userfile<<arr_username[i]<<endl;
userfile<<arr_password[i]<<endl;
}
//storing user firstname to file
userfile<<usr_fname<<endl;
//storing user lastname to file
userfile<<usr_lname<<endl;
//storing user dob to file
userfile<<dob<<endl;
//storing user contact number to file
userfile<<contact_num<<endl;
//storing user type to file
userfile<<usr_type<<endl;
//storing user username to file
userfile<<username<<endl;
//storing user password to file
userfile<<password<<endl;
//closing file
userfile.close();
//Calling genVerificationCode()
verification_code = genVerificationCode();
sendCodeByEmail(verification_code);
}
//else display error message
else
cout<<"\n\tUnable to open file";
}
}
//receive dob
//extract year
//convert to int and return
int getAge(string dob)
{
int n = dob.length();
string year;
// declaring character array
char* arr_dob = new char[n+1];
int i=0;
// copying the contents of the
// string to char array
strcpy(arr_dob, dob.c_str());
/* for (int i=0; i<n; i++)
cout << arr_dob[i];
*/
// Returns first token
char *token = strtok(arr_dob, "/");
i=0;
// Keep printing tokens while one of the
// delimiters present in arr_dob[].
while (i<3)
{
year = token;
token = strtok(NULL, "/");
i++;
}
delete (arr_dob);
return 2018-stoi(year);
}
//function to check if the username already exist
//if user exists the function will return false
//else user will return true
bool isUsernameUnique(string username)
{
//required variable to hold the data content of file
string temp;
//ifstream class object to read data content from Users.txt file
ifstream file ("Users.txt");
//check if file exists or is open successfully
if(file.is_open())
{
//reading data line by line
//checking the username if exists then return false
//else return true
while(!file.eof())
{
//reading firstname and ignore
getline(file,temp);
//reading lastname and ignore
getline(file,temp);
//reading dob and ignore
getline(file,temp);
//reading contact number and ignore
getline(file,temp);
//reading user type and ignore
getline(file,temp);
//reading username
getline(file,temp);
//check if username is same as entered by new user
if(username==temp)
{
//username is not unique return false
cout<<"\tUsername already exists.\n";
//closing file
file.close();
return false;
}
//reading password
getline(file,temp);
//reading status
getline(file,temp);
}
//closing file
file.close();
return true;
}
//closing file
file.close();
return true;
}
// Generates 3 digit random number
// numbers in range [lower, upper].
int genVerificationCode()
{
//declaring lower and upper limit
int lower=100;
int upper=999;
//number variable will hold the generated random number
int num = (rand() % (upper - lower + 1)) + lower;
//returning the generated random number
return num;
}
//receive the verification code
//save verification code to the file named Email.txt
void sendCodeByEmail(int verificationCode)
{
//ofstream class object to hold email.txt file
ofstream emailFile("Email.txt");
//check if file opened successfully
if(emailFile.is_open())
{
//saving verification code to the file name Email.txt
emailFile<<verificationCode<<endl;
//closing file
emailFile.close();
//display message
cout<<"\n\tVerification code has been sended to your Email\n\t";
system("pause");
}
//else display error message
else
cout<<"\n\tUnable to open file";
}
//Display the verification screen
//Prompt the user to enter the verification code
//if code is valid then proceed further
//otherwise prompt again
//after 3 attempt go back to login screen
bool displayVerificationScreen()
{
//required variable to hold the verification code entered by user
int verification_code,temp_code;
int attempt=0;
bool isverified=false;
//ifstream class object
ifstream emailFile("Email.txt");
//check if file open successfully
if(emailFile.is_open())
{
//read code from the file
emailFile>>temp_code;
//closing the file
emailFile.close();
}
else
cout<<"\n\tUnable to open the file!";
while(attempt<3)
{
//prompt user to enter the verification code
cout<<"\tEnter your's verification code :";
cin>>verification_code;
//check if user entered verification code is valid
if(verification_code==temp_code)
{
isverified=true;
break;
}
else
{
cout<<"\n\t"<<3-attempt<<" attempts left of 3"<<endl;
attempt++;
}
}
//check the attempts are over or isverified
if(isverified)
{
return true;
}
else
return false;
}
//prompt user for username and password
//check if username and password exists
//and valid then login else display message
void signIn()
{
//required variable to hold the username and password
string username,password;
string temp_username,temp_password,temp_usertype;
string temp;
bool isvalid=false;
//Calling clearScreen()
do
{
clearScreen();
//Display the title
cout<<"\n\t***************************"
<<"\n\t*** Enter Login Details ***"
<<"\n\t***************************\n"<<endl;
//ifsstream class object
ifstream userFile("Users.txt");
//prompt for the username
cout<<"\n\tEnter your Username :";
cin>>username;
//prompt for the password
cout<<"\tEnter your password :";
cin>>password;
//check if file is opened properly
if(userFile.is_open())
{
//iterate through every record
while(!userFile.eof())
{
//reading firstname and ignore
getline(userFile,temp);
//reading lastname and ignore
getline(userFile,temp);
//reading dob and ignore
getline(userFile,temp);
//reading contact number and ignore
getline(userFile,temp);
//reading user type and ignore
getline(userFile,temp_usertype);
//reading username
getline(userFile,temp_username);
//reading password
getline(userFile,temp_password);
//check if the username and password are valid
if(username==temp_username && password==temp_password)
{
isvalid=true;
break;
}
}
if(!isvalid)
{
cout<<"\n\tInvalid username or password. Please try again...\n\t";
system("pause");
}
}
else
cout<<"\n\tUnable to open file!";
//closing file
userFile.close();
}while(!isvalid);
//Calling displayVerificationScreen()
isvalid = displayVerificationScreen();
//check if verification code is valid
if(isvalid)
{
//Calling gotoMainMenu()
gotoMainMenu(temp_usertype,username);
}
else
{
clearScreen();
signIn();
}
}
//receive usertype and username
//display Main Menu according to the user type
void gotoMainMenu(string usertype,string username)
{
//check for the user type
if(usertype=="Admin")
{
displayMainAdminMenu(username);
}
else if(usertype =="Teacher")
{
displayTeacherMenu(username);
}
else if(usertype =="Student")
{
displayStudentMenu(username);
}
}
//display Admin Menu
void displayMainAdminMenu(string username)
{
int user_choice;
do
{
//Calling clearScreen()
clearScreen();
//display menu
cout<<"\n\t*************************"
<<"\n\t*** Admin Main Menu ***"
<<"\n\t*************************";
cout<<"\n\n\t1. All course enrollment requests"<<endl
<<"\t2. All course assignment requests"<<endl
<<"\t3. sign out"<<endl;
cout<<"\n\tEnter your choice : ";
cin>>user_choice;
switch(user_choice)
{
case 1:
CourseEnrolRequest();
break;
case 2:
CourseAssignRequest();
break;
case 3:
return ;
break;
default:
cout<<"\n\tInvalid choice please try again...";
}
}while(user_choice!=3);
}
//display Teacher Menu
void displayTeacherMenu(string username)
{
int user_choice;
do
{
//Calling clearScreen()
clearScreen();
//display menu
cout<<"\n\t*************************"
<<"\n\t*** Teacher Main Menu ***"
<<"\n\t*************************";
cout<<"\n\n\t1. Select Course"<<endl
<<"\t2. View Selected Course"<<endl
<<"\t3. View Enrolled Student in a Courses"<<endl
<<"\t4. sign out"<<endl;
cout<<"\n\tEnter your choice : ";
cin>>user_choice;
switch(user_choice)
{
case 1:
selectCourse(username);
break;
case 2:
ViewSelectedCourseList(username);
break;
case 3:
ViewEnrolStudentInCourse(username);
break;
case 4:
return ;
break;
default:
cout<<"\n\tInvalid choice please try again...";
}
}while(user_choice!=4);
}
//display Student Menu
void displayStudentMenu(string username)
{
int user_choice;
do
{
//Calling clearScreen()
clearScreen();
//display menu
cout<<"\n\t*************************"
<<"\n\t*** Student Main Menu ***"
<<"\n\t*************************";
cout<<"\n\n\t1. Enroll course"<<endl
<<"\t2. View Enrolled Courses"<<endl
<<"\t3. View Assigned Teacher by Course"<<endl
<<"\t4. sign out"<<endl;
cout<<"\n\tEnter your choice : ";
cin>>user_choice;
switch(user_choice)
{
case 1:
EnrollRequests(username);
break;
case 2:
ViewEnrolCourseList(username);
break;
case 3:
ViewAssignedTeacherToCourse(username);
break;
case 4:
return ;
break;
default:
cout<<"\n\tInvalid choice please try again...";
}
}while(user_choice!=4);
}
//view list of all courses and apply to select a course
//check if the course is not already added by this teacher
//check if more then 3 courses are selected by the teacher
void selectCourse(string username)
{
//required variable
int numOfCourse=0;
string c_code[100],c_Title[100],c_creditHr[100],c_theory[100],c_lab[100];
string temp;
int courseSel=0;
bool validCourse=false;
//ifstream class object
ifstream courseFile("Courses.txt");
//ClearScreen
clearScreen();
cout<<"\n\t******************************"
<<"\n\t*** Select Course To Teach ***"
<<"\n\t******************************\n";
//check maximum selected course
if(!isMaxSelCourseReached(username))
{
//check if file exists or is open successfully
if(courseFile.is_open())
{
//reading data line by line
//checking the username if exists then return false
//else return true
while(!courseFile.eof())
{
//reading course code
getline(courseFile,c_code[numOfCourse]);
//reading course code
getline(courseFile,c_Title[numOfCourse]);
//reading course code
getline(courseFile,c_creditHr[numOfCourse]);
//reading course code
getline(courseFile,c_theory[numOfCourse]);
//reading course code
getline(courseFile,c_lab[numOfCourse]);
numOfCourse++;
}
courseFile.close();
}
if(numOfCourse<=0)
{
cout<<"\n\tNo courses to select...!";
system("pause");
return;
}
else
{
if(!isMaxSelCourseReached(username))
{
cout<<"\n\tSelect from following list of courses:\n";
cout<<"\n\t"<<setw(8)<<"SrNo."<<setw(10)<<"Course Code"<<setw(50)<<"Title"<<setw(10)<<"Credit Hr"<<setw(10)<<"Theory"<<setw(10)<<"Lab"<<endl;
for(int i=0;i<numOfCourse;i++)
{
cout<<"\n\t"<<setw(8)<<i+1<<setw(10)<<c_code[i]<<setw(50)<<c_Title[i]<<setw(10)<<c_creditHr[i]<<setw(10)<<c_theory[i]<<setw(10)<<c_lab[i];
}
do
{
cout<<"\n\tSelect from above list using the SrNo. as a selection :";
cin>>courseSel;
validCourse=isCourseAlreadySelected(c_code[courseSel-1],username);
if(validCourse)
{
cout<<"\n\tCourse already selected please try other course ...!\n";
system("pause");
return ;
}
}while(validCourse);
//applying for the course selection process
//saving to the file
applyCourseSelection(username,c_code[courseSel-1]);
}
else
{
cout<<"\n\tOoops! you reached maximum limit of the Course Selection...";
cout<<endl;
system("pause");
return ;
}
}
}
else
{
cout<<"\n\tYou already have reached maximum course selection i.e 3.\n";
system("pause");
return;
}
}
//check if the course is already selected by the logged in user
//if course is selected then return true
//otherwise return false
bool isCourseAlreadySelected(string c_code,string username)
{
//required variables
bool isAlreadySelected=false;
string temp_tname,temp_ccode,temp_cstatus;
//ifstream class object
ifstream teacherSelectedCourseFile("TeacherSelectedCourses.txt");
//check if file is ready to open successfully
if(teacherSelectedCourseFile.is_open())
{
while(!teacherSelectedCourseFile.eof())
{
//reading teacher name from file
getline(teacherSelectedCourseFile,temp_tname);
if(temp_tname!="")
{
do{
//reading course code from the file
getline(teacherSelectedCourseFile,temp_ccode);
//check if it is the last record of the course for the teacher
if(temp_ccode!="***")
{
//check if the course already exists
if(temp_ccode==c_code)
{
isAlreadySelected=true;
teacherSelectedCourseFile.close();
return true;
}
//reading course code approval status from the file
getline(teacherSelectedCourseFile,temp_cstatus);
}
else
break;
}while(temp_ccode!="***");
}
else
break;
}
}
teacherSelectedCourseFile.close();
return false;
}
//check if the maximum course is selected by the logged in user
//if maximum course selection reach to 3 then return true
//otherwise return false
bool isMaxSelCourseReached(string username)
{
//required variables
int numOfCourse=0;
string temp_tname,temp_ccode,temp_cstatus;
//ifstream class object
ifstream teacherSelectedCourseFile("TeacherSelectedCourses.txt");
//check if file is ready to open successfully
if(teacherSelectedCourseFile.is_open())
{
while(!teacherSelectedCourseFile.eof())
{
//reading teacher name from file
//search for the logged in teacher
getline(teacherSelectedCourseFile,temp_tname);
if(temp_tname!="")
{
//check if the teacher is current logged in teacher
if(temp_tname==username)
{
do{
getline(teacherSelectedCourseFile,temp_ccode);
if(temp_ccode!="***")
{
getline(teacherSelectedCourseFile,temp_cstatus);
numOfCourse++;
}
else
break;
}while(temp_ccode!="***");
break;
}
else
{
do{
getline(teacherSelectedCourseFile,temp_ccode);
}while(temp_ccode!="***");
}
}
else
break;
}
}
teacherSelectedCourseFile.close();
if(numOfCourse==3)
{
return true;
}
else
return false;
}
//receive teacher unique id and course code