Zoo Management System OOPs in C++ (Grade A+)
Summary:
The PDF document “Zoo Management System OOPs in C++” offers a comprehensive guide to building a zoo management system using Object-Oriented Programming (OOP) in C++. The project is structured into various classes, functions, and attributes, focusing on the principles of OOP, such as composition, associations, aggregations, and inheritance. The document is divided into multiple sections, each detailing specific aspects of the zoo management system. It starts with the ‘Zoo’ class, which includes attributes like zoo code, name, capacity, and location. The ‘Visitor’ class is designed to manage visitor information, including name, ID, age, and gender. The ‘Animal’ class is another crucial part of the system, covering attributes like animal type, ID, name, weight, age, and food type. The document also includes derived classes like ‘Reptile’ and ‘Bird,’ each with unique attributes and needs. The code is well-commented, making it easy to understand the logic and flow of the program. This project report is an invaluable resource for students and professionals looking to understand or develop a zoo management system using C++.
Excerpt:
Zoo Management System OOPs in C++
PROGRAM:
#include”stdafx.h”
#include<iostream>
#include<string>
usingnamespacestd;
////////////////zooclass///////////////////////
classzoo
{
protected:
intzoo_code;
stringzoo_name;
intzoo_capacity;
stringzoo_place;
public:
zoo()//defaultconstructor
{}
zoo(intzc,stringzn,intzc1,stringzp):zoo_code(zc),zoo_name(zn),zoo_capacity(zc1),zoo_place(zp)
{}//parameterizeconstructor
voidinput()
{
cout<<“enterzoocode”<<endl;
cin>>zoo_code;
cout<<“enterzooname”<<endl;
cin>>zoo_name;
cout<<“enterzoocapacity”<<endl;
cin>>zoo_capacity;
cout<<“enterzooplace”<<endl;
cin>>zoo_place;
}
voidoutput()
{
cout<<“\tthezoocodeis”<<zoo_code<<endl;
cout<<“\tthezoonameis”<<zoo_name<<endl;
cout<<“\tthezoocapacityis”<<zoo_capacity<<endl;
cout<<“\tthezooplaceis”<<zoo_place<<endl;
}
};
/////////////////////Visitorclass//////////////
classvisitor
{
protected:
stringv_name;
intv_id;
intv_age;
stringv_gender;
stringv_cnic;
zooobject;
public:
visitor()//default
{}
visitor(stringvn,intvi,intva,stringvg,stringvc):
v_name(vn),v_id(vi),v_age(va),v_gender(vg),v_cnic(vc)
{}//parameterized
voidinput()
{
object.input();
cout<<“entervisitorname”<<endl;
cin>>v_name;
cout<<“entervisitorid”<<endl;
cin>>v_id;
cout<<“entervisitorage”<<endl;
cin>>v_age;
cout<<“entervisitorgender”<<endl;
cin>>v_gender;
cout<<“entervisitorCNIC”<<endl;
cin>>v_cnic;
}
voidoutput()
{
object.output();
cout<<“\tvisitornameis”<<v_name<<endl;
cout<<“\tvisitoridis”<<v_id<<endl;
cout<<“\tvisitorageis”<<v_age<<endl;
cout<<“\tvisitorgenderis”<<v_gender<<endl;
cout<<“\tvisitorCNICis”<<v_cnic<<endl;
}
};
/////////////////////Animalclass//////////////
classanimal
{
protected:
intA_id;
stringA_name;
stringA_type;
floatA_weight;
intA_age;
stringA_foodType;
zooobject1;
public:
animal()//defaultconstructor
{}
animal(intai,stringan,stringat,floataw,intaa,stringft):
A_id(ai),A_name(an),A_type(at),A_weight(aw),A_age(aa),A_foodType(ft){}//parameterizeconstructor
virtualvoidinput()//virtualfunction
{
object1.input();
cout<<“enteranimaltype(reptile,birds,mammals,fish,amphibians)”<<endl;cin>>A_type;
cout<<“enteranimalid”<<endl;
cin>>A_id;
cout<<“enteranimalname”<<endl;
cin>>A_name;
cout<<“enteranimalweight”<<endl;
cin>>A_weight;
cout<<“enteranimalage”<<endl;
cin>>A_age;
cout<<“enteranimalfoodtype”<<endl;
cin>>A_foodType;
}
virtualvoidoutput()
{
object1.output();
cout<<“\tthetypeofanimalis”<<A_type<<endl;
cout<<“\ttheidofanimalis”<<A_id<<endl;
cout<<“\tthenameofanimalis”<<A_name<<endl;
cout<<“\ttheanimalweightis”<<A_weight<<endl;
cout<<“\ttheanimalageis”<<A_age<<endl;
cout<<“\ttheanimalfoodis”<<A_foodType<<endl;
}
};
//////////////////derivedclassofanimal///////////
classreptile:publicanimal
{
protected:
stringR_type;
stringR_specialNeed;
stringpoisonous;
public:
reptile():animal()//default
{}
reptile(stringa,stringb,stringc,intai,stringan,stringat,floataw,intaa,stringft):
ZoomanagementsystemR_type(a),R_specialNeed(b),poisonous(c),animal(ai,an,at,aw,aa,ft)
{}
voidinput()//overridding
{
animal::input();
cout<<“enterreptiletype”<<endl;
cin>>R_type;
cout<<“enterreptilespecialneed”<<endl;
cin>>R_specialNeed;
cout<<“enterpoisonousbehaviour(y/N)”<<endl;
cin>>poisonous;
}
Reviews