Docsity

Matlab-Object Oriented Programming-C Language Codes, Exercises of Object Oriented Programming

Toggle sidebar
bg1
#include"copmuter.h"
class MAIN_LB:public chem_lab,public PHYSICS_lab,public bio,public comput
{
float z;
int input;
public:
int get_menu()
{
while(1)
{
q1:
z=0;
cin.clear();
cout<<" IN WHICH LAB YOU WANT TO ENTER\n\n";
cout<<" PRESS 1 FOR BIOLOGY LAB\n";
cout<<" PRESS 2 FOR COMPUTER LAB\n";
cout<<" \tPRESS 3 FOR CHEMISTRY LAB\n";
cout<<" PRESS 4 FOR PHYSICS LAB\n";
cout<<" PRESS 5 FOR EXIT\n";
cin>>z;
system("cls");
input=z;
if(z-input>0)
{
cout<<"Not a valid option \n";
goto q1;
}
if ( input!=1 && input!=2 && input!=3 && input!=4 &&
input!=5 )
{
cout<<"Not a Valid choice \n" ;
cin.clear () ;
cin.ignore (INT_MAX,'\n') ;
continue ;
}
switch(input)
{
case 1:
biology_menu();
break;
case 2:
computer_menu();
break;
case 3:
chemistry_menu();
break;
case 4:
physics_menu();
break;
case 5:
return 1;
break;
docsity.com
pf2

Partial preview of the text

Download Matlab-Object Oriented Programming-C Language Codes and more Exercises Object Oriented Programming in PDF only on Docsity!

#include"copmuter.h"

class MAIN_LB:public chem_lab,public PHYSICS_lab,public bio,public comput { float z; int input; public: int get_menu() { while(1) { q1: z=0; cin.clear(); cout<<" IN WHICH LAB YOU WANT TO ENTER\n\n"; cout<<" PRESS 1 FOR BIOLOGY LAB\n"; cout<<" PRESS 2 FOR COMPUTER LAB\n"; cout<<" \tPRESS 3 FOR CHEMISTRY LAB\n"; cout<<" PRESS 4 FOR PHYSICS LAB\n"; cout<<" PRESS 5 FOR EXIT\n"; cin>>z; system("cls"); input=z; if(z-input>0) { cout<<"Not a valid option \n"; goto q1; }

if ( input!=1 && input!=2 && input!=3 && input!=4 && input!=5 ) { cout<<"Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; continue ; } switch(input) { case 1: biology_menu(); break; case 2: computer_menu(); break; case 3: chemistry_menu(); break; case 4: physics_menu(); break; case 5: return 1; break;

docsity.com

default: goto q1;

} } } };

docsity.com