





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






#include"biology_lab.h" #include"type.h" class comput {
stu student_chem[100]; float cm; int record_no,com_rec_edit,b; rec_handler record_computer[100]; attendant computer_attendant; location com_lab_location; capacity com_lab_capacity; timings com_lab_timings; Type type_of_com[20]; public: comput():record_no(0),com_rec_edit(0){} int computer_menu() { int a; while(1) { q11: cin.clear(); cout<<"PRESS \n 1 FOR VIEWING LAB INFORMATION \n"; cout<<"2 FOR EDITING DATA \n"; cout<<"3 FOR HAVING A LAB SESSION \n"; cout<<"4 FOR VIEWING YOUR LAB PARTICULARS \n"; cout<<"5 TO VIEW STUDENT RECORD \n"; cout<<"6 TO RETURN TO MAIN MENU \n"; cin>>cm; system("cls"); flushall(); a=cm; if(cm-a>0) { cout<<"Not a valid option \n"; goto q11; } if ( a!=1 && a!=2 && a!=3 && a!=4 && a!=5 && a!=6) { cout << "Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; continue ; } switch(a) { case 1: get1_rec(); break; case 2: set_rec(); break; case 3:
lab_session(); break; case 4: A: cin.clear(); cout<<"ENTER YOUR TOKEN NUMBER\n"; cin>>b; system("cls"); if(b<1||b>record_no) { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto A ; } view_lab(b); break; case 5: C: cin.clear(); cout<<"ENTER REGISTRATION NUMBER OF STUDENT\n"; cin>>b; system("cls"); if(b<0||b>99) { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto C ; } view_STUDENT(b); break; case 6: return 1; break; } } } void get1_rec() {
cout<<"^^^^^^^^^^^^^^^^^^^^^LAB LOCATION^^^^^^^^^^^^^^^^^^^^^"<<endl<<endl; cout<<"COLLEGE NAME------"<<com_lab_location.g1_r()<<endl; cout<<"LAB NAME---------- "<<com_lab_location.g2_r()<<endl<<endl; cout<<"^^^^^^^^^^^^^^^^^^^^^LAB TIMINGS^^^^^^^^^^^^^^^^^^^^^^"<<endl<<endl; cout<<"OPENING TIME------ "<<com_lab_timings.g_rec()<<"hrs"<<endl; cout<<"CLOSING TIME------ "<<com_lab_timings.g1_rec()<<"hrs"<<endl; cout<<"^^^^^^^^^^^^^^^^^^^^^LAB CAPACITY^^^^^^^^^^^^^^^^^^^^^"<<endl<<endl;
cin.getline(computer_attendant.get_rc(),100,'\n'); system("cls"); cout<<"enter experiance of attendant\n"; flushall(); cin.getline(computer_attendant.gt_rc(),100,'\n'); system("cls"); cout<<"enter registration number of attendant\n"; flushall(); cin.getline(computer_attendant.g_rc(),100,'\n'); system("cls"); break; case 2: cout<<"enter name of college\n"; flushall(); cin.getline(com_lab_location.g1_r(),100,'\n'); system("cls"); flushall(); cout<<"enter name of LAB\n"; cin.getline(com_lab_location.g2_r(),100,'\n'); system("cls"); break; case 3: H: cin.clear(); cout<<"enter number of students which can be accumudated in lab\n"; flushall(); int k; cin>>k; system("cls"); if(k>0) { com_lab_capacity.get_students()=k; } else { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto H ; } break; case 4: F: cin.clear(); cout<<"enter opening time of lab\n"; flushall(); k=0; cin>>k; system("cls"); if(k>=0 && k<=2400) { com_lab_timings.g_rec()=k; }
else { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto F ; } G: cin.clear(); cout<<"enter closing time of lab\n"; flushall(); k=0; cin>>k; system("cls"); if(k>=com_lab_timings.g_rec() && k<=2400) { com_lab_timings.g1_rec()=k; } else { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto G ; } break; case 5: E: cin.clear(); cout<<"PRESS 1 FOR NEW COMPUTER PRESS 2 FOR EDITING COMPUTER"; cin>>c; if(c!=1 && c!=2) { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto E ; } if(c==1) { cout<<"ENTER NAME OF COMPUTER\n"; flushall();
cin.getline(type_of_com[com_rec_edit].get_name(),100,'\n'); system("cls"); int g; C: cin.clear(); cout<<"ENTER NUMBER OF COMPUTER\n"; cin>>g; flushall(); if(g<0) {
break; case 6: D: cin.clear(); cout<<"ENTER REGISTRATION NUMBER OF STUDENT\n"; flushall(); cin>>b;system("cls"); if(b<0||b>99) { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; goto D ; } edit_STUDENT(b); case 7: return 1; break; } } } void lab_session() { cout<<"ENTER DATE OF LAB SESSION\n"; flushall(); cin>>record_computer[0].get_dt(1); system("cls"); cout<<"ENTER MONTH OF LAB SESSION\n"; flushall(); cin>>record_computer[0].get_dt(2); system("cls"); cout<<"ENTER YEAR OF LAB SESSION\n"; flushall(); cin>>record_computer[0].get_dt(3); system("cls"); cout<<"ENTER NO. OF STUDENTS YOU WANT TO HAVE A LAB SESSION\n"; flushall(); cin>>record_computer[0].get_c(); system("cls"); cout<<"ENTER STARTING TIME OF LAB IN hrs (FORM 0100-2400)\n"; flushall(); cin>>record_computer[0].get_t(1); system("cls"); cout<<"ENTER ENDING TIME OF LAB IN hrs (FORM 0100-2400)\n"; flushall(); cin>>record_computer[0].get_t(2); system("cls"); comparison(); } void comparison() { int i; for(i=1;i<100;i++)
if( (record_computer[i].get_dt(1)==record_computer[0].get_dt(1))&&(record_com puter[i].get_dt(2)==record_computer[0].get_dt(2))
&&(record_computer[i].get_dt(3)==record_computer[0].get_dt(3))&&(re cord_computer[i].get_t(1)==record_computer[0].get_t(1))
&&(record_computer[i].get_t(2)==record_computer[0].get_t(2)) ) { cout<<"SORRY YOU CAN NOT HAVE LAB SESSION AS ON THE SPECIFIED DATE AND TIME THERE IS ANOTHER LAB\n"; break; } if( (record_computer[0].get_c()>com_lab_capacity.get_students()) || (record_computer[0].get_t(1)<com_lab_timings.g_rec()) || (record_computer[0].get_t(2)>com_lab_timings.g1_rec()) ) { cout<<"SORRY YOU CAN NOT HAVE LAB SESSION AS SPECIFIED PARTICULARS ARE NOT MATCHING WITH LAB PARTICULARS\n"; break; } } if(i==100) { record_no++;
record_computer[record_no].get_dt(1)=record_computer[0].get_dt(1);
record_computer[record_no].get_dt(2)=record_computer[0].get_dt(2);
record_computer[record_no].get_dt(3)=record_computer[0].get_dt(3);
record_computer[record_no].get_c()=record_computer[0].get_c();
record_computer[record_no].get_t(1)=record_computer[0].get_t(1);
record_computer[record_no].get_t(2)=record_computer[0].get_t(2); cout<<"YOUR REQUEST FOR LAB IS ACCEPTED\nYOUR TOKEN NUMber is "<<record_no<<endl; } } void view_lab(int a) { cout<<"YOUR LAB WILL hold AT (dd/mm/yy) "<<record_computer[a].get_dt(1)<<"/"
<<record_computer[a].get_dt(2)<<"/"<<record_computer[a].get_dt(3)<< endl;