#include<stdio.h><br />    #include<conio.h><br />    #include<dos.h><br />    #include<string.h><br />    void main()<br />    {<br />    int iCh1,iInc;<br />    e:<br />    clrscr();<br />    /* To Display Main menu */<br />    gotoxy(26,40);<br />    textcolor(9);<br />    cprintf(\"
SOFTWARE ENGINEERING PROJECT\"
);<br />    gotoxy(32,44);<br />    textcolor(19);<br />    cprintf(\"
BATCH-1(2006-07)\"
);<br />    gotoxy(23,42);<br />    cprintf(\"
ZOO MANAGEMENT SYSTEM ( ZMS-2007)\"
);<br />    gotoxy(8,45);<br />    textcolor(9);<br />    /* To Dispaly date and time */<br />    cprintf(\"
DATE : %s \"
,__DATE__);<br />    gotoxy(55,45);<br />    cprintf(\"
TIME : %s \"
,__TIME__);<br />    for(iInc=0;iInc<=30;iInc++)<br />    {<br />    gotoxy(20,iInc);<br />    textcolor(7);<br />    cprintf(\"
-\"
);<br />    }<br />    for(iInc=0;iInc<80;iInc++)<br />    {<br />    gotoxy(iInc,30);<br />    textcolor(7);<br />    cprintf(\"
|\"
);<br />    }<br />    gotoxy(30,8);<br />    textcolor(9);<br />    /* Main menu */<br />    cprintf(\"
ZOO MANAGEMENT SYSTEM (ZMS-2007)\"
);<br />    gotoxy(30,10);<br />    textcolor(19);<br />    cprintf(\"
1.ANIMAL\"
);<br />    gotoxy(30,12);<br />    cprintf(\"
2.BIRD\"
);<br />    gotoxy(30,14);<br />    cprintf(\"
3.EXIT\"
);<br />    gotoxy(30,18);<br />    textcolor(9);<br />    cprintf(\"
ENTER YOUR CHOICE:\"
);<br />    scanf(\"
%d\"
,&iCh1);<br />    if<br />    (iCh1==3)<br />    {<br />    /* To exit from the system */<br />    gotoxy(30,28);<br />    textcolor(4);<br />    cprintf(\"
SYSTEM SHUTTING DOWN\"
);<br />    sleep(3);<br />    gotoxy(26,40);<br />    printf(\"
SOFTWARE ENGINEERING PROJECT\"
);<br />    gotoxy(8,42);<br />    printf(\"
ZOO MANAGEMENT SYSTEM ( ZMS-2007)\"
);<br />    gotoxy(8,45);<br />    printf(\"
DATE : %s \"
,__DATE__);<br />    gotoxy(55,45);<br />    printf(\"
TIME : %s \"
,__TIME__);<br />    exit(0);<br />    }<br />    else{<br />    /* Declarations of Variables */<br />    FILE *fp,*ft;<br />    char cAns,cChoice;<br />    struct zoo<br />    {<br />    char offspr[2],anim_history[50],an_name[30],keeper_nm[20],cellid[4],an_sex[2];<br />    int anim_age,offno;<br />    float wt,offrat,inbreed,food_s,food_c;<br />    };<br />    struct zoo e;<br />    char cell_id[4];<br />    int iF=0,iC=0,iF1=0;<br />    long int lRecsize;<br />    fp=fopen(\"
zm.dat\"
,\"
rb+\"
);<br />    if(fp==NULL)<br />    {<br />    fp=fopen(\"
\zm.dat\"
,\"
wb+\"
);<br />    if(fp==NULL)<br />    {<br />    puts(\"
\n\t\tCannot Open file\"
);<br />    exit();<br />    }<br />    }<br />    lRecsize=sizeof(e);<br />    while(1)<br />    {<br />    clrscr();<br />    textcolor(4);<br />    if(iCh1==1) {<br />    gotoxy(30,8);<br />    textcolor(4);<br />    cprintf(\"
ANIMAL MENU\"
); }<br />    else if(iCh1==2) {<br />    gotoxy(30,8);<br />    textcolor(4);<br />    cprintf(\"
BIRD MENU\"
); }<br />    gotoxy(26,40);<br />    textcolor(4);<br />    cprintf(\"
SOFTWARE ENGINEERING PROJECT\"
);<br />    gotoxy(32,44);<br />    textcolor(19);<br />    cprintf(\"
BATCH-1(2006-07)\"
);<br />    gotoxy(23,42);<br />    textcolor(19);<br />    cprintf(\"
ZOO MANAGEMENT SYSTEM ( ZMS-2007 )\"
);<br />    gotoxy(8,45);<br />    textcolor(4);<br />    cprintf(\"
DATE : %s \"
,__DATE__);<br />    gotoxy(55,45);<br />    cprintf(\"
TIME : %s \"
,__TIME__);<br />    for(iInc=0;iInc<=30;iInc++)<br />    {<br />    gotoxy(20,iInc);<br />    textcolor(7);<br />    cprintf(\"
-\"
);<br />    }<br />    for(iInc=0;iInc<=80;iInc++)<br />    {<br />    gotoxy(iInc,30);<br />    textcolor(7);<br />    cprintf(\"
|\"
);<br />    }<br />    gotoxy(30,10);<br />    textcolor(19);<br />    cprintf(\"
1.ADD \"
);<br />    gotoxy(30,12);<br />    cprintf(\"
2.DISPLAY\"
);<br />    gotoxy(30,14);<br />    cprintf(\"
3.MODIFY\"
);<br />    gotoxy(30,16);<br />    cprintf(\"
4.DELETE\"
);<br />    gotoxy(30,18);<br />    cprintf(\"
5.EXIT\"
);<br />    gotoxy(30,20);<br />    textcolor(4);<br />    cprintf(\"
SELECT YOUR OPTION: \"
);<br />    fflush(stdin);<br />    cChoice=getche();<br />    clrscr();<br />    gotoxy(25,8);<br />    textcolor(5);<br />    switch(cChoice)<br />    {<br />    case '1':<br />    //To add a record<br />    w:<br />    printf(\"
\n\n\n\t\tENTER CELL ID( 3 DIGIT NO.): \"
);<br />    scanf(\"
%s\"
,cell_id);<br />    rewind(fp);<br />    //Checking for unique id<br />    while(fread(&e,lRecsize,1,fp)==1)<br />    {<br />    if(strcmp(e.cellid,cell_id)==0)<br />    {<br />    iF=1;<br />    printf(\"
\n\t\tTHE ID ALREADY EXISTS\"
);<br />    goto w;<br />    }}<br />    if(iF==0||fread(&e,lRecsize,1,fp)==0)<br />    {<br />    fseek (fp,0,SEEK_END);<br />    strcpy(e.cellid,cell_id);<br />    a3:<br />    printf(\"
\n\t\tENTER ANIMAL NAME: \"
);<br />    scanf(\"
%s\"
,e.an_name);<br />    if(strlen(e.an_name)>30||strlen(e.an_name)<3)<br />    goto a3;<br />    printf(\"
\n\t\tENTER ZOO KEEPER NAME: \"
);<br />    scanf(\"
%s\"
,e.keeper_nm); <br />    p:<br />    printf(\"
\n\t\tENTER SEX [M/F]: \"
);<br />    scanf(\"
%s\"
,e.an_sex);<br />    if(strlen(e.an_sex)>1)<br />    goto p;<br />    f:<br />    printf(\"
\n\t\tENTER AGE : \"
);<br />    scanf(\"
%d\"
,&e.anim_age);<br />    if(e.anim_age<0||e.anim_age>100)<br />    goto f; <br />    a5:<br />    printf(\"
\n\t\tOFFSPRING [P/A]:\"
);<br />    scanf(\"
%s\"
,&e.offspr);<br />    if(strlen(e.offspr)>1)<br />    goto a5;<br />    printf(\"
\n\t\tENTER NO. OF OFFSPRING: \"
);<br />    scanf(\"
%d\"
,&e.offno);<br />    printf(\"
\n\t\tFOOD SUPPLIED( IN KG): \"
);<br />    scanf(\"
%f\"
,&e.food_s);<br />    printf(\"
\n\t\tFOOD CONSUMED( IN KG): \"
);<br />    scanf(\"
%f\"
,&e.food_c);<br />    a2:<br />    printf(\"
\n\t\tANIMAL DETAILS(IF ANY)\n\t\t(Don't leave space,use '_'): \"
);<br />    scanf(\"
%s\"
,e.anim_history);<br />    if(strlen(e.anim_history)>50)<br />    goto a2;<br />    fwrite(&e,lRecsize,1,fp);<br />    /*Flushes a stream On success returns 0 , On error returns EOF */<br />    fflush(stdin);<br />    }<br />    break;<br />    case '2':<br />    //Searching and displaying all the infor<br />    //     mation by id<br />    textcolor(7);<br />    printf(\"
\n\n\n\t\tENTER CELL ID: \"
);<br />    scanf(\"
%s\"
,cell_id);<br />    rewind(fp);<br />    while(fread(&e,lRecsize,1,fp)!=0)<br />    {<br />    if(strcmp(e.cellid,cell_id)==0)<br />    { iC=1;<br />    clrscr();<br />    //Display according to Main menu<br />    gotoxy(0,20);<br />    //ANIMAL<br />    if(iCh1==1){<br />    printf(\"
\n\n\n\t\tDETAILS OF THE ANIMAL:%s\"
,strupr(e.an_name));<br />    printf(\"
\n_____________________________________________________________________\n\n\"
);<br />    printf(\"
\n\n NAME : %s\t CELL ID : %s\t ZOO KEEPER NAME : %s\n\n SEX: %s\t AGE : %d \n\n OFFSPRING: %s\n\n OFFSPRING NO. : %d\n\n OFFSPRING RATIO : %f\n\n INBREED RATIO : %f\n\n FOOD SUPPLIED : %f\n\n FOOD CONSUMED : %f\n\n ANIMAL DETAILS: %s\"
,strupr(e.an_name),strupr(e.cellid),strupr(e.keeper_nm),strupr(e.an_sex),e.anim_age,strupr(e.offspr),e.offno,(e.offno/13.33*6.2),(e.offno*12.66/17.3574),e.food_s,e.food_c,strupr(e.anim_history));<br />    printf(\"
\n_____________________________________________________________________\n\n\"
);<br />    getch(); }<br />    //BIRD<br />    else if(iCh1==2){<br />    printf(\"
\n\n\n\t\tDETAILS OF BIRD:%s\"
,strupr(e.an_name));<br />    printf(\"
\n_____________________________________________________________________\n\n\"
);<br />    printf(\"
\n\n NAME : %s\t CELL ID : %s\t ZOO KEEPER NAME : %s\n\n AGE: %d\t SEX : %s \t OFFSPRING: %s\n\n OFFSPRING NO. : %d\n\n OFFSPRING RATIO : %f\n\n INBREED RATIO : %f\n\n FOOD SUPPLIED : %f\n\n FOOD CONSUMED : %f\n\n ANIMAL DETAILS: %s\"
,strupr(e.an_name),strupr(e.cellid),strupr(e.keeper_nm),e.anim_age,strupr(e.an_sex),strupr(e.offspr),e.offno,(e.offno/13.33*6.2),(e.offno*12.66/17.3574),e.food_s,e.food_c,strupr(e.anim_history));<br />    printf(\"
\n_____________________________________________________________________\n\n\"
);<br />    getch(); }<br />    }<br />    }<br />    if(iC==0)<br />    {<br />    printf(\"
\n\t\tRECORD DOESN'T EXISTS..\"
);<br />    getch();<br />    }iC=0;<br />    break;<br />    case '3':<br />    //Searching and modifying Records by id<br />    cAns='y';<br />    while(cAns=='y')<br />    {<br />    printf(\"
\n\n\n\t\tENTER CELL ID: \"
);<br />    scanf(\"
%s\"
,cell_id);<br />    rewind(fp);<br />    while(fread(&e,lRecsize,1,fp)==1)<br />    {<br />    if(strcmp(e.cellid,cell_id)==0)<br />    {<br />    b:<br />    printf(\"
\n\n\t\tENTER ANIMAL NAME: %s : \"
,strupr(e.an_name));<br />    scanf(\"
%s\"
,e.an_name);<br />    if(strlen(e.an_name)>20||strlen(e.an_name)<3)<br />    goto b;<br />    b1:<br />    printf(\"
 \n\t\tENTER SEX : %s : \"
,strupr(e.an_sex));<br />    scanf(\"
%s\"
,e.an_sex);<br />    if(strlen(e.an_sex)>1)<br />    goto b1;<br />    r:<br />    printf(\"
 \n\t\tENTER AGE: %d : \"
 ,e.anim_age);<br />    scanf(\"
%d\"
,&e.anim_age);<br />    if(e.anim_age<1||e.anim_age>100)<br />    goto r;<br />    ad:<br />    printf(\"
 \n\t\tOFFSPRING : %s : \"
,strupr(e.offspr));<br />    scanf(\"
%s\"
,e.offspr);<br />    if(strlen(e.offspr)<1)<br />    goto ad;<br />    printf(\"
 \n\t\tENTER NO. OF OFFSPRING: %d :\"
,e.offno);<br />    scanf(\"
%d\"
,&e.offno);<br />    printf(\"
 \n\t\tENTER FOOD SUPPLIED(IN KG): %f :\"
,e.food_s);<br />    scanf(\"
%f\"
,&e.food_s);<br />    printf(\"
\n\t\tFOOD CONSUMED( IN KG): \"
);<br />    scanf(\"
%f\"
,&e.food_c);<br />    b5:<br />    printf(\"
\n\t\tANIMAL DETAILS( IF ANY )\n\t\t(Dont leave space,use'_'instead)': %s : \"
,e.anim_history);<br />    scanf(\"
%s\"
,e.anim_history);<br />    if(strlen(e.anim_history)>50)<br />    goto b5;<br />    fseek(fp,-lRecsize,SEEK_CUR); //Repositions the file pointer of a stream<br />    fwrite(&e,lRecsize,1,fp);<br />    printf(\"
\n\t\tRECORD MODIFIED \"
);<br />    break;<br />    }<br />    }<br />    printf(\"
\n\n\n\t\tDO U WANT TO MODIFY ANY RECORD[y/n]\"
);<br />    /*Flushes a stream On success returns 0 , On error returns EOF */<br />    fflush(stdin);<br />    cAns=getche();<br />    }<br />    break;<br />    case '4':<br />    //Searching and deleting records by id<br />    cAns='y';<br />    while(cAns=='y')<br />    {<br />    printf(\"
\n\n\t\tENTER CELL ID TO DELETE RECORD : \"
);<br />    scanf(\"
%s\"
,cell_id);<br />    ft=fopen(\"
temp.dat\"
,\"
wb\"
);<br />    rewind(fp); //Repositions file pointer to stream's beginning<br />    while(fread(&e,lRecsize,1,fp)!=0)<br />    {<br />    if(strcmp(e.cellid,cell_id)!=0) {<br />    fwrite(&e,lRecsize,1,ft);<br />    }<br />    else {<br />    iF1=1;<br />    printf(\"
\n\n\t\t RECORD DELETED SUCCESSFULLY\"
);<br />    }<br />    }<br />    if(iF1!=1){iF1=0;<br />    printf(\"
\n\n\t\t NO SUCH RECORD FOUND\"
);}<br />    fclose(fp);<br />    fclose(ft);<br />    remove(\"
zm.dat\"
);<br />    rename(\"
temp.dat\"
,\"
zm.dat\"
);<br />    fp=fopen(\"
zm.dat\"
,\"
rb+\"
);<br />    printf(\"
\n\n\t\tDO U WANT TO DELETE ANOTHER RECORD[y/n]\"
);<br />    fflush(stdin);<br />    cAns=getche();<br />    }<br />    break;<br />    case '5':<br />    fclose(fp);<br />    goto e;<br />    }<br />    }<br />    }<br />    }<br />
Zoo management  adri jovin
Zoo management  adri jovin
Zoo management  adri jovin
Zoo management  adri jovin
Zoo management  adri jovin
Zoo management  adri jovin
Zoo management  adri jovin

More Related Content

DOCX
Wildlife conservation project management adri jovin
PDF
Fine-grained Processing of CVS Archives with APFEL
PDF
JavaScript pitfalls
PDF
Perl 5.28 new features
PDF
Kernel Recipes 2016 - Why you need a test strategy for your kernel development
KEY
20110424 action scriptを使わないflash勉強会
PDF
Airport traffic control simple database model
PDF
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
Wildlife conservation project management adri jovin
Fine-grained Processing of CVS Archives with APFEL
JavaScript pitfalls
Perl 5.28 new features
Kernel Recipes 2016 - Why you need a test strategy for your kernel development
20110424 action scriptを使わないflash勉強会
Airport traffic control simple database model
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);

What's hot (20)

PDF
6 things about perl 6
PDF
GDG DevFest Kyoto 2014 これからのGoの話をしよう
PDF
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
PPS
36 gotas de-sabiduria
DOCX
24 bit wallace_tree_multiplier
PDF
Of class3
TXT
Yg byev2e
PDF
Top 10 php classic traps DPC 2020
PDF
Amazon VPC and Amazon EC2
PDF
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
DOCX
Hangman Game Programming in C (coding)
DOCX
(Meta 2.3) figura de auto con simbolos dev c++
PDF
"Internationalisation with PHP and Intl" source code
DOC
5 Rmi Print
DOCX
Deber base
PDF
One definition rule - что это такое, и как с этим жить
PDF
The Ring programming language version 1.5.2 book - Part 8 of 181
PDF
Perl Bag of Tricks - Baltimore Perl mongers
PDF
LAMP_TRAINING_SESSION_7
DOCX
Project fast food automaton
6 things about perl 6
GDG DevFest Kyoto 2014 これからのGoの話をしよう
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
36 gotas de-sabiduria
24 bit wallace_tree_multiplier
Of class3
Yg byev2e
Top 10 php classic traps DPC 2020
Amazon VPC and Amazon EC2
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
Hangman Game Programming in C (coding)
(Meta 2.3) figura de auto con simbolos dev c++
"Internationalisation with PHP and Intl" source code
5 Rmi Print
Deber base
One definition rule - что это такое, и как с этим жить
The Ring programming language version 1.5.2 book - Part 8 of 181
Perl Bag of Tricks - Baltimore Perl mongers
LAMP_TRAINING_SESSION_7
Project fast food automaton
Ad

Similar to Zoo management adri jovin (19)

PDF
READ BEFORE YOU START Please read the given Word document fo.pdf
PDF
Abstract Base Class (C++ Program)Create an abstract base class cal.pdf
PDF
C programs Set 4
PDF
Note Modified codecode#includeiostream #include stdio.h.pdf
PDF
READ BEFORE YOU START You are given a partially completed pr.pdf
PPT
Unit5 C
PPT
Read write program
TXT
System programs in C language.
PDF
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
DOCX
Design problem
TXT
Hospital management
TXT
Hospital management
PPT
file handling1
PPT
Ch8 file processing
PPTX
Input output functions
PPTX
C ISRO Debugging
PDF
program on string in java Lab file 2 (3-year)
PDF
HERE is a C PROGRAM BELOW EVERYTIME I TRY TO RUN IT ON MATRIX IT GI.pdf
DOCX
#include stdio.h#include stdlib.htypedef FILE stream.docx
READ BEFORE YOU START Please read the given Word document fo.pdf
Abstract Base Class (C++ Program)Create an abstract base class cal.pdf
C programs Set 4
Note Modified codecode#includeiostream #include stdio.h.pdf
READ BEFORE YOU START You are given a partially completed pr.pdf
Unit5 C
Read write program
System programs in C language.
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Design problem
Hospital management
Hospital management
file handling1
Ch8 file processing
Input output functions
C ISRO Debugging
program on string in java Lab file 2 (3-year)
HERE is a C PROGRAM BELOW EVERYTIME I TRY TO RUN IT ON MATRIX IT GI.pdf
#include stdio.h#include stdlib.htypedef FILE stream.docx
Ad

More from Adri Jovin (20)

PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
DOCX
Curriculum Vitae of Adri Jovin John Joseph
PPTX
Introduction to Relational Database Management Systems
PPTX
Introduction to ER Diagrams
PPTX
Introduction to Database Management Systems
PPTX
Neural Networks
PPTX
Introduction to Genetic Algorithm
PPTX
Introduction to Fuzzy logic
PPTX
Introduction to Artificial Neural Networks
PPTX
Introductory Session on Soft Computing
PPTX
Creative Commons
PPTX
Image based security
PPTX
Blockchain Technologies
PPTX
Introduction to Cybersecurity
PPTX
Advanced Encryption System & Block Cipher Modes of Operations
PPTX
Heartbleed Bug: A case study
PPTX
Zoom: Privacy and Security - A case study
PPTX
Elliptic Curve Cryptography
PPTX
El Gamal Cryptosystem
PPTX
Data Encryption Standard
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Curriculum Vitae of Adri Jovin John Joseph
Introduction to Relational Database Management Systems
Introduction to ER Diagrams
Introduction to Database Management Systems
Neural Networks
Introduction to Genetic Algorithm
Introduction to Fuzzy logic
Introduction to Artificial Neural Networks
Introductory Session on Soft Computing
Creative Commons
Image based security
Blockchain Technologies
Introduction to Cybersecurity
Advanced Encryption System & Block Cipher Modes of Operations
Heartbleed Bug: A case study
Zoom: Privacy and Security - A case study
Elliptic Curve Cryptography
El Gamal Cryptosystem
Data Encryption Standard

Recently uploaded (20)

PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPT
What is a Computer? Input Devices /output devices
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PPTX
The various Industrial Revolutions .pptx
PDF
Architecture types and enterprise applications.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PPT
Geologic Time for studying geology for geologist
PPTX
2018-HIPAA-Renewal-Training for executives
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
Flame analysis and combustion estimation using large language and vision assi...
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Microsoft Excel 365/2024 Beginner's training
sbt 2.0: go big (Scala Days 2025 edition)
What is a Computer? Input Devices /output devices
Getting started with AI Agents and Multi-Agent Systems
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
The various Industrial Revolutions .pptx
Architecture types and enterprise applications.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Convolutional neural network based encoder-decoder for efficient real-time ob...
OpenACC and Open Hackathons Monthly Highlights July 2025
Geologic Time for studying geology for geologist
2018-HIPAA-Renewal-Training for executives
Module 1.ppt Iot fundamentals and Architecture
Improvisation in detection of pomegranate leaf disease using transfer learni...
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Flame analysis and combustion estimation using large language and vision assi...
Benefits of Physical activity for teenagers.pptx
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx

Zoo management adri jovin

  • 1. #include<stdio.h><br /> #include<conio.h><br /> #include<dos.h><br /> #include<string.h><br /> void main()<br /> {<br /> int iCh1,iInc;<br /> e:<br /> clrscr();<br /> /* To Display Main menu */<br /> gotoxy(26,40);<br /> textcolor(9);<br /> cprintf(\" SOFTWARE ENGINEERING PROJECT\" );<br /> gotoxy(32,44);<br /> textcolor(19);<br /> cprintf(\" BATCH-1(2006-07)\" );<br /> gotoxy(23,42);<br /> cprintf(\" ZOO MANAGEMENT SYSTEM ( ZMS-2007)\" );<br /> gotoxy(8,45);<br /> textcolor(9);<br /> /* To Dispaly date and time */<br /> cprintf(\" DATE : %s \" ,__DATE__);<br /> gotoxy(55,45);<br /> cprintf(\" TIME : %s \" ,__TIME__);<br /> for(iInc=0;iInc<=30;iInc++)<br /> {<br /> gotoxy(20,iInc);<br /> textcolor(7);<br /> cprintf(\" -\" );<br /> }<br /> for(iInc=0;iInc<80;iInc++)<br /> {<br /> gotoxy(iInc,30);<br /> textcolor(7);<br /> cprintf(\" |\" );<br /> }<br /> gotoxy(30,8);<br /> textcolor(9);<br /> /* Main menu */<br /> cprintf(\" ZOO MANAGEMENT SYSTEM (ZMS-2007)\" );<br /> gotoxy(30,10);<br /> textcolor(19);<br /> cprintf(\" 1.ANIMAL\" );<br /> gotoxy(30,12);<br /> cprintf(\" 2.BIRD\" );<br /> gotoxy(30,14);<br /> cprintf(\" 3.EXIT\" );<br /> gotoxy(30,18);<br /> textcolor(9);<br /> cprintf(\" ENTER YOUR CHOICE:\" );<br /> scanf(\" %d\" ,&iCh1);<br /> if<br /> (iCh1==3)<br /> {<br /> /* To exit from the system */<br /> gotoxy(30,28);<br /> textcolor(4);<br /> cprintf(\" SYSTEM SHUTTING DOWN\" );<br /> sleep(3);<br /> gotoxy(26,40);<br /> printf(\" SOFTWARE ENGINEERING PROJECT\" );<br /> gotoxy(8,42);<br /> printf(\" ZOO MANAGEMENT SYSTEM ( ZMS-2007)\" );<br /> gotoxy(8,45);<br /> printf(\" DATE : %s \" ,__DATE__);<br /> gotoxy(55,45);<br /> printf(\" TIME : %s \" ,__TIME__);<br /> exit(0);<br /> }<br /> else{<br /> /* Declarations of Variables */<br /> FILE *fp,*ft;<br /> char cAns,cChoice;<br /> struct zoo<br /> {<br /> char offspr[2],anim_history[50],an_name[30],keeper_nm[20],cellid[4],an_sex[2];<br /> int anim_age,offno;<br /> float wt,offrat,inbreed,food_s,food_c;<br /> };<br /> struct zoo e;<br /> char cell_id[4];<br /> int iF=0,iC=0,iF1=0;<br /> long int lRecsize;<br /> fp=fopen(\" zm.dat\" ,\" rb+\" );<br /> if(fp==NULL)<br /> {<br /> fp=fopen(\" \zm.dat\" ,\" wb+\" );<br /> if(fp==NULL)<br /> {<br /> puts(\" \n\t\tCannot Open file\" );<br /> exit();<br /> }<br /> }<br /> lRecsize=sizeof(e);<br /> while(1)<br /> {<br /> clrscr();<br /> textcolor(4);<br /> if(iCh1==1) {<br /> gotoxy(30,8);<br /> textcolor(4);<br /> cprintf(\" ANIMAL MENU\" ); }<br /> else if(iCh1==2) {<br /> gotoxy(30,8);<br /> textcolor(4);<br /> cprintf(\" BIRD MENU\" ); }<br /> gotoxy(26,40);<br /> textcolor(4);<br /> cprintf(\" SOFTWARE ENGINEERING PROJECT\" );<br /> gotoxy(32,44);<br /> textcolor(19);<br /> cprintf(\" BATCH-1(2006-07)\" );<br /> gotoxy(23,42);<br /> textcolor(19);<br /> cprintf(\" ZOO MANAGEMENT SYSTEM ( ZMS-2007 )\" );<br /> gotoxy(8,45);<br /> textcolor(4);<br /> cprintf(\" DATE : %s \" ,__DATE__);<br /> gotoxy(55,45);<br /> cprintf(\" TIME : %s \" ,__TIME__);<br /> for(iInc=0;iInc<=30;iInc++)<br /> {<br /> gotoxy(20,iInc);<br /> textcolor(7);<br /> cprintf(\" -\" );<br /> }<br /> for(iInc=0;iInc<=80;iInc++)<br /> {<br /> gotoxy(iInc,30);<br /> textcolor(7);<br /> cprintf(\" |\" );<br /> }<br /> gotoxy(30,10);<br /> textcolor(19);<br /> cprintf(\" 1.ADD \" );<br /> gotoxy(30,12);<br /> cprintf(\" 2.DISPLAY\" );<br /> gotoxy(30,14);<br /> cprintf(\" 3.MODIFY\" );<br /> gotoxy(30,16);<br /> cprintf(\" 4.DELETE\" );<br /> gotoxy(30,18);<br /> cprintf(\" 5.EXIT\" );<br /> gotoxy(30,20);<br /> textcolor(4);<br /> cprintf(\" SELECT YOUR OPTION: \" );<br /> fflush(stdin);<br /> cChoice=getche();<br /> clrscr();<br /> gotoxy(25,8);<br /> textcolor(5);<br /> switch(cChoice)<br /> {<br /> case '1':<br /> //To add a record<br /> w:<br /> printf(\" \n\n\n\t\tENTER CELL ID( 3 DIGIT NO.): \" );<br /> scanf(\" %s\" ,cell_id);<br /> rewind(fp);<br /> //Checking for unique id<br /> while(fread(&e,lRecsize,1,fp)==1)<br /> {<br /> if(strcmp(e.cellid,cell_id)==0)<br /> {<br /> iF=1;<br /> printf(\" \n\t\tTHE ID ALREADY EXISTS\" );<br /> goto w;<br /> }}<br /> if(iF==0||fread(&e,lRecsize,1,fp)==0)<br /> {<br /> fseek (fp,0,SEEK_END);<br /> strcpy(e.cellid,cell_id);<br /> a3:<br /> printf(\" \n\t\tENTER ANIMAL NAME: \" );<br /> scanf(\" %s\" ,e.an_name);<br /> if(strlen(e.an_name)>30||strlen(e.an_name)<3)<br /> goto a3;<br /> printf(\" \n\t\tENTER ZOO KEEPER NAME: \" );<br /> scanf(\" %s\" ,e.keeper_nm); <br /> p:<br /> printf(\" \n\t\tENTER SEX [M/F]: \" );<br /> scanf(\" %s\" ,e.an_sex);<br /> if(strlen(e.an_sex)>1)<br /> goto p;<br /> f:<br /> printf(\" \n\t\tENTER AGE : \" );<br /> scanf(\" %d\" ,&e.anim_age);<br /> if(e.anim_age<0||e.anim_age>100)<br /> goto f; <br /> a5:<br /> printf(\" \n\t\tOFFSPRING [P/A]:\" );<br /> scanf(\" %s\" ,&e.offspr);<br /> if(strlen(e.offspr)>1)<br /> goto a5;<br /> printf(\" \n\t\tENTER NO. OF OFFSPRING: \" );<br /> scanf(\" %d\" ,&e.offno);<br /> printf(\" \n\t\tFOOD SUPPLIED( IN KG): \" );<br /> scanf(\" %f\" ,&e.food_s);<br /> printf(\" \n\t\tFOOD CONSUMED( IN KG): \" );<br /> scanf(\" %f\" ,&e.food_c);<br /> a2:<br /> printf(\" \n\t\tANIMAL DETAILS(IF ANY)\n\t\t(Don't leave space,use '_'): \" );<br /> scanf(\" %s\" ,e.anim_history);<br /> if(strlen(e.anim_history)>50)<br /> goto a2;<br /> fwrite(&e,lRecsize,1,fp);<br /> /*Flushes a stream On success returns 0 , On error returns EOF */<br /> fflush(stdin);<br /> }<br /> break;<br /> case '2':<br /> //Searching and displaying all the infor<br /> // mation by id<br /> textcolor(7);<br /> printf(\" \n\n\n\t\tENTER CELL ID: \" );<br /> scanf(\" %s\" ,cell_id);<br /> rewind(fp);<br /> while(fread(&e,lRecsize,1,fp)!=0)<br /> {<br /> if(strcmp(e.cellid,cell_id)==0)<br /> { iC=1;<br /> clrscr();<br /> //Display according to Main menu<br /> gotoxy(0,20);<br /> //ANIMAL<br /> if(iCh1==1){<br /> printf(\" \n\n\n\t\tDETAILS OF THE ANIMAL:%s\" ,strupr(e.an_name));<br /> printf(\" \n_____________________________________________________________________\n\n\" );<br /> printf(\" \n\n NAME : %s\t CELL ID : %s\t ZOO KEEPER NAME : %s\n\n SEX: %s\t AGE : %d \n\n OFFSPRING: %s\n\n OFFSPRING NO. : %d\n\n OFFSPRING RATIO : %f\n\n INBREED RATIO : %f\n\n FOOD SUPPLIED : %f\n\n FOOD CONSUMED : %f\n\n ANIMAL DETAILS: %s\" ,strupr(e.an_name),strupr(e.cellid),strupr(e.keeper_nm),strupr(e.an_sex),e.anim_age,strupr(e.offspr),e.offno,(e.offno/13.33*6.2),(e.offno*12.66/17.3574),e.food_s,e.food_c,strupr(e.anim_history));<br /> printf(\" \n_____________________________________________________________________\n\n\" );<br /> getch(); }<br /> //BIRD<br /> else if(iCh1==2){<br /> printf(\" \n\n\n\t\tDETAILS OF BIRD:%s\" ,strupr(e.an_name));<br /> printf(\" \n_____________________________________________________________________\n\n\" );<br /> printf(\" \n\n NAME : %s\t CELL ID : %s\t ZOO KEEPER NAME : %s\n\n AGE: %d\t SEX : %s \t OFFSPRING: %s\n\n OFFSPRING NO. : %d\n\n OFFSPRING RATIO : %f\n\n INBREED RATIO : %f\n\n FOOD SUPPLIED : %f\n\n FOOD CONSUMED : %f\n\n ANIMAL DETAILS: %s\" ,strupr(e.an_name),strupr(e.cellid),strupr(e.keeper_nm),e.anim_age,strupr(e.an_sex),strupr(e.offspr),e.offno,(e.offno/13.33*6.2),(e.offno*12.66/17.3574),e.food_s,e.food_c,strupr(e.anim_history));<br /> printf(\" \n_____________________________________________________________________\n\n\" );<br /> getch(); }<br /> }<br /> }<br /> if(iC==0)<br /> {<br /> printf(\" \n\t\tRECORD DOESN'T EXISTS..\" );<br /> getch();<br /> }iC=0;<br /> break;<br /> case '3':<br /> //Searching and modifying Records by id<br /> cAns='y';<br /> while(cAns=='y')<br /> {<br /> printf(\" \n\n\n\t\tENTER CELL ID: \" );<br /> scanf(\" %s\" ,cell_id);<br /> rewind(fp);<br /> while(fread(&e,lRecsize,1,fp)==1)<br /> {<br /> if(strcmp(e.cellid,cell_id)==0)<br /> {<br /> b:<br /> printf(\" \n\n\t\tENTER ANIMAL NAME: %s : \" ,strupr(e.an_name));<br /> scanf(\" %s\" ,e.an_name);<br /> if(strlen(e.an_name)>20||strlen(e.an_name)<3)<br /> goto b;<br /> b1:<br /> printf(\" \n\t\tENTER SEX : %s : \" ,strupr(e.an_sex));<br /> scanf(\" %s\" ,e.an_sex);<br /> if(strlen(e.an_sex)>1)<br /> goto b1;<br /> r:<br /> printf(\" \n\t\tENTER AGE: %d : \" ,e.anim_age);<br /> scanf(\" %d\" ,&e.anim_age);<br /> if(e.anim_age<1||e.anim_age>100)<br /> goto r;<br /> ad:<br /> printf(\" \n\t\tOFFSPRING : %s : \" ,strupr(e.offspr));<br /> scanf(\" %s\" ,e.offspr);<br /> if(strlen(e.offspr)<1)<br /> goto ad;<br /> printf(\" \n\t\tENTER NO. OF OFFSPRING: %d :\" ,e.offno);<br /> scanf(\" %d\" ,&e.offno);<br /> printf(\" \n\t\tENTER FOOD SUPPLIED(IN KG): %f :\" ,e.food_s);<br /> scanf(\" %f\" ,&e.food_s);<br /> printf(\" \n\t\tFOOD CONSUMED( IN KG): \" );<br /> scanf(\" %f\" ,&e.food_c);<br /> b5:<br /> printf(\" \n\t\tANIMAL DETAILS( IF ANY )\n\t\t(Dont leave space,use'_'instead)': %s : \" ,e.anim_history);<br /> scanf(\" %s\" ,e.anim_history);<br /> if(strlen(e.anim_history)>50)<br /> goto b5;<br /> fseek(fp,-lRecsize,SEEK_CUR); //Repositions the file pointer of a stream<br /> fwrite(&e,lRecsize,1,fp);<br /> printf(\" \n\t\tRECORD MODIFIED \" );<br /> break;<br /> }<br /> }<br /> printf(\" \n\n\n\t\tDO U WANT TO MODIFY ANY RECORD[y/n]\" );<br /> /*Flushes a stream On success returns 0 , On error returns EOF */<br /> fflush(stdin);<br /> cAns=getche();<br /> }<br /> break;<br /> case '4':<br /> //Searching and deleting records by id<br /> cAns='y';<br /> while(cAns=='y')<br /> {<br /> printf(\" \n\n\t\tENTER CELL ID TO DELETE RECORD : \" );<br /> scanf(\" %s\" ,cell_id);<br /> ft=fopen(\" temp.dat\" ,\" wb\" );<br /> rewind(fp); //Repositions file pointer to stream's beginning<br /> while(fread(&e,lRecsize,1,fp)!=0)<br /> {<br /> if(strcmp(e.cellid,cell_id)!=0) {<br /> fwrite(&e,lRecsize,1,ft);<br /> }<br /> else {<br /> iF1=1;<br /> printf(\" \n\n\t\t RECORD DELETED SUCCESSFULLY\" );<br /> }<br /> }<br /> if(iF1!=1){iF1=0;<br /> printf(\" \n\n\t\t NO SUCH RECORD FOUND\" );}<br /> fclose(fp);<br /> fclose(ft);<br /> remove(\" zm.dat\" );<br /> rename(\" temp.dat\" ,\" zm.dat\" );<br /> fp=fopen(\" zm.dat\" ,\" rb+\" );<br /> printf(\" \n\n\t\tDO U WANT TO DELETE ANOTHER RECORD[y/n]\" );<br /> fflush(stdin);<br /> cAns=getche();<br /> }<br /> break;<br /> case '5':<br /> fclose(fp);<br /> goto e;<br /> }<br /> }<br /> }<br /> }<br />