Docsity

C++ Program for Biology Lab Menu in Zoology and Botony, Exercises of Object Oriented Programming

Toggle sidebar
bg1
#include"zoology.h"
class bio:public botony_lab,public zoology_lab
{
int a;
float b;
public:
int biology_menu()
{
//cout<<b<<endl;
while(1)
{
q6:
b=0;
cin.clear();
cout<<"IN WHICH LAB YOU WANT TO ENTER\n";
cout<<"PRESS 1 FOR BOTONY LAB\n";
cout<<"PRESS 2 FOR ZOOLOGY LAB\n";
cout<<"PRESS 3 FOR GOING BACK\n";
flushall();
cin>>b;
system("cls");
a=b;
if(b-a>0)
{
cout<<"Not a valid option \n";
flushall();
goto q6;
}
if ( a!=1 && a!=2 && a!=3 )
{
cout << "Not a Valid choice \n" ;
cin.clear () ;
cin.ignore (INT_MAX,'\n') ;
continue ;
}
switch(a)
{
case 1:
botony_menu();
break;
case 2:
zoology_menu();
break;
case 3:
b=0;
return 1;
break;
default:
goto q6;
}
}
}
};
docsity.com

Partial preview of the text

Download C++ Program for Biology Lab Menu in Zoology and Botony and more Exercises Object Oriented Programming in PDF only on Docsity!

#include"zoology.h" class bio:public botony_lab,public zoology_lab { int a; float b; public: int biology_menu() { //cout<<b<<endl; while(1) { q6: b=0; cin.clear(); cout<<"IN WHICH LAB YOU WANT TO ENTER\n"; cout<<"PRESS 1 FOR BOTONY LAB\n"; cout<<"PRESS 2 FOR ZOOLOGY LAB\n"; cout<<"PRESS 3 FOR GOING BACK\n"; flushall(); cin>>b; system("cls"); a=b; if(b-a>0) { cout<<"Not a valid option \n"; flushall(); goto q6; } if ( a!=1 && a!=2 && a!=3 ) { cout << "Not a Valid choice \n" ; cin.clear () ; cin.ignore (INT_MAX,'\n') ; continue ; } switch(a) { case 1: botony_menu(); break; case 2: zoology_menu(); break; case 3: b=0; return 1; break; default: goto q6; } } } };

docsity.com