Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

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

A c++ program for a biology lab menu that allows users to choose between botony lab, zoology lab, or going back to the main menu. The program uses classes and inheritance, with functions for displaying the menu and taking user input.

Typology: Exercises

2011/2012

Uploaded on 07/31/2012

netu
netu 🇮🇳

4.5

(4)

55 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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