You are on page 1of 61

Dissertation Report

WILDLIFE CONSERAVATION MANAGEMENT SYSTEM


A Report submitted
In partial fulfillment of the award of the degree of

B.C.A
Session 2007-2010

Submitted by:
ARIBA NAJIB
2007-301-027

Under the guidance of


Mrs.Farheen Siddiqui
(Assistant Professor)
Faculty of Computer Science

Department of Computer Science

JAMIA HAMDARD
New Delhi

1
DECLARATION

I hereby declare that the minor project work entitled WILDLIFE


CONSERVATION MANAGEMENT SYSTEM submitted for the BCA (3yrs
course) is my original work carried out by me under the guidance of Mrs.Farheen
Siddiqui for the partial fulfillment of the award of the degree of the Bachelor
of Computer Applications. The matter embodied in this report has not been submitted
anywhere else for the award of any other degree/diploma.

Place: New Delhi.


Date: 15th April 2010

Signature of the candidate

2
`

ACKNOWLEDGEMENT

I would like to thanks to all my guides who really acted as pillars to help my way
throughout this project that has led to successful and satisfactory completion of this
project.

Firstly I would like to thank my project incharge Mrs.Farheen Siddiqui under whose
able guidance and motivation this work has been performed.

The inspiration of the faculty members of the Computer Science Department of


JAMIA HAMDARD enabled me to make a thorough study of this subject.

NAME -Ariba Najib

ENROLL.NO. - 2007-301-010

3
ABSTRACT

The project, WILDLIFE CONSERVATION MANAGEMENT SYSTEM ,deals


basically with the information about endangered and non-endangered species of birds
and animals living in sanctuaries and national parks respectively. It thus helps in
creating awareness about the endangered fauna in India. The complete information
about various animals is available at the click of the mouse via this project. The
project also helps in adding, modifying, deleting and displaying records related to
animals and birds categorized either as endangered or non-endangered species. Each
record of the particular bird or animal contains entire information and details
including its name, cell ID where it is being kept, zoo keeper’s name and likewise.
The proposed system can manage all drawbacks of the existing manual system.

4
Sno. Table of Contents Page
No.

1 List of Abbreviations 6

2 List of figures 7

3 List of tables 8

4 Introduction 9

5 Objective 10

6 Problem Selection 11
7 System Study 12

8 Cost Benefit 14
8.1 benefit category 15

9 Project monitoring System 16


9.1 PERT Chart 17
9.2 Actual Process 18
System Design 19
10.1 Data Flow Diagram 20
10.2 E.R.Diagram 23
10 10.3 Data Dictionary 25
10.4 Tools to be used 27

11 Documentation 28

12 Output 42

13 System Testing 49

14 Implementation 52
15 Conclusion 53
16 Scope 54
17 References 55

5
List of Abbreviations

Sno. Abbreviations Word

1 Rec Records

2 RA Requirement Analysis

3 Ackn Acknowledgment

4 Prg Programs

5 H/w Hardware

6 S/w Software

6
List of Figures

S.No. Table No. Description of table Page No.


1. 10.1.1 Context level diagram of wildlife 21
conservation management system

2. 10.1.2 Level 1 DFD for Process 1.0 22


3. 10.2 Entity-Relationship 24
Diagram

7
List of Tables

s.no. Table no. Description of table Pageno.


1. 10.2.1 ZOO_DB1.DAT 26
2. 10.2.2 ZOO_DB2.DAT 26

8
INTRODUCTION

Today, IT industry is an industry which brings changes in the working environment


of our society in a convenient and efficient way. IT industry is flourishing and has its
scope in relatively all the fields. We are in an era of change and can do away with all
the obstacles of the current prevailing system. While studying and analyzing the
working of this system, there were many problems that occurred. These problems are:

 Manual system is a time consuming system, i.e. manual system takes a large
amount of time for processing queries generated by the user.
 There is a possibility of duplicity of data in manual system. Due to this, there is
also a possibility of inconsistency.
 Manual system is difficult to operate.
 It is more costly.
 It uses more man power.

9
OBJECTIVES OF THE PROJECT

The main objective of the WILDLIFE CONSERVATION MANAGEMENT


SYSTEM is to perform all the functions or operations accurately and correctly. It
overcomes all the problems that we have in our existing system. Our existing system
is as follows:

 Duplication of data: - Duplication of data means that the same record was
repeated a number of times. Due to this, our database becomes lengthy and
difficult to maintain. If there is duplication of data, then there is a possibility
of inconsistency of data. Due to the above problem, it is very difficult to
handle the database

 Update Problem:- The updation problem is further categorized into three


category:-

 Insertion Problem: - . It doesn’t enforce any constraint over the user while
inputting data in the table. The user may enter irrelevant, false information in
the table. That result inaccuracy, inconsistency of record. In our new
computerized record keeping system, domains are specified that enforces the
user to input valid data. For example, the user can enter the incorrect data in
the table, which may lead to irrelevant or false data.

 Manipulation Problem: - In the existing system, there is a possibility of


duplication of records. The manipulation of record is successful if it is done to
all the duplicate records. For example, if a record is entered in the table twice,
and there is only one record is updated and then there is a problem in query
handling.

 Deletion problem: - If a product data is to be


deleted from the database and if the table has duplicate records than the entire
duplicate records have to be deleted and the practical implementation of this is
not possible.

 Apart from the duplication and updation problem, there is another problem
which is that our existing system is very slow. The process of inserting,
updating or deleting of records is limited to the speed of operator. And
maintaining registers or papers is very difficult, there is need of extra storage
space and person who maintains the registers of records. There are more
chances of losing the records during handling them.

10
PROBLEM SELECTION

The existing system in the companies is manual where all the work is done manually
by entering the records in the various files and folders.
Maintaining these files requires a lot of space as well as lot of man power. Also there
is a possibility of duplicacy of data and data inconsistency.
Therefore the requirements of the project are as follows:
 Greater storage capacity.
 Greater processing speed of input and output operations
 More reliable and consistent procedure to eliminate errors in handling day to
day processing.

11
SYSTEM STUDY

System Study is to measure that how beneficial or practical the development of an


information system will be to an organization. It is also known as the Feasibility
study.

FEASIBILITY STUDY

A feasibility study is undertaken to determine the possibility of either improving the


existing system or developing a completely new system. This study helps to obtain an
overview of the problem and to get rough assessment of whether feasible solutions
exist. Since the feasibility study may lead to the commitment of large resources, it is
important that it is conducted completely and that no fundamental errors of judgement
are made.
The purpose of feasibility study is to determine whether the
requested project is successfully realizable. There are three aspects of feasibility
study, namely
(a) Technical feasibility
(b) Economic feasibility
(c) Operational feasibility
 Operational feasibility
Operational feasibility must determines how the proposed system will fit in with
the current operations and what, if any, job restructuring and retraining will be
needed to implement the system.
The analyst should determine:
 Whether the system can be used if it is developed and
implemented?
 Will there be resistance from users that will cripple the possible
application benefit?
 How well the solution will work and how the end-users and staff members
feel about the system. This people oriented test measures the urgency of
the problem or the acceptability of a solution i.e. Is the problem worth
solving?
PIECE is used as the basis for analyzing the urgency of problem or the effectiveness
of a solution.

PIECE stands for:


P – Performance
I – Information
E – Economics
C – Control
E – Efficiency

12
 Technical feasibility
The purpose of assessing technical feasibility is to gain an understanding of the
organization’s ability to construct the proposed system. Technical feasibility
determines whether the technology needed for the proposed system is available and
how it can be integrated with in the organization. Technical evaluation must also
assess whether the staff have the technical expertise to assimilate and use the new
technology.
 Whether the project can be carried out with the existing equipments?
The existing system is manual system where all the work is done
manually. So this project is new technology.
The technical feasibility centers on the existing computer system and to what extent it
can support the proposed system.

 Economic feasibility
The purpose of assessing economic feasibility is to identify the financial benefits and
costs associated with the development project. Economic feasibility is often known as
cost-benefits analysis.
To carry out an economic feasibility study, it is necessary to estimate
actual money values against any purchase or activities needed to implement the
project. It is also necessary to assess money value against any benefits that will
accrue from a new system created by the project.
There are mainly two categories/analysis to determine economic feasibility: -
 Cost category
 Benefit category

13
COST-BENEFITS ANALYSIS

Cost Categories
Equipment cost It includes various items of computing equipment associated with
the work.

Operating cost It includes the expense to run the system. Operating cost depends
on the amount of time taken for a process i.e., it includes the cost
associated with the day to day operation of the system.

Personnel cost It includes the salaries and wages of analyst, programmers,


operators, consultants etc. Salary may be on hourly basis or the
entire salary for the duration of the project.

Material cost It includes cost of stationary, paper, ribbons, floppies, CD’s etc.

Conversion cost It includes that of designing new forms and procedures,


expenditure to prepare the project for using the new system.

14
Benefit Categories
Performance The criteria emphasize whether the new system has resulted in a
marked improvement in the accuracy in access to information.
Does the new system provide easier and secure access to the
authorized user.

Minimizing cost If the new system is efficient with minimum error, reduction of
staff is a benefit that should be measured and included in cost
benefit analysis

15
PROJECT MONITORING SYSTEM

PERT CHART: -
A PERT chart is a project management tool used to schedule, organize, and
coordinate tasks within a project. PERT stands for Program Evaluation Review
Technique. A PERT chart presents a graphic illustration of a project as a network
diagram consisting of numbered nodes (either circles or rectangles) representing
events, or milestones in the project linked by labeled vectors (directional lines)
representing tasks in the project.

The direction of the arrows on the lines indicates the sequence of tasks.

Arrow is used to represents task.

Circle represents the beginning or completion of task.

The PERT chart process includes following steps: -


1) Identifies the specific activitiy and milestone.
2) Determine the proper sequence of the activities.
3) Construct a network diagram.
4) Estimate the time required for each activity.
5) Determine the critical path.
6) Update the PERT chart as the process progresses.

16
PERT CHART

Problem Feasibility
Definition 2 study
1 2

System analyze
3

Flow chart DFD


4 5 4

Data Dictionary 6

Coding 7

I
Testing 8 30

Figure 6.2: - PERT chart

17
Actual Process

S.No Phase Time Estimate in days Actual Time

1. Problem Definition 1 4

2. Feasibility study 5 5

3. System analysis and design


3.1. Flow Chart 3 3
3.2. DFD 2 6
3.3. Data Dictionary 1 2
3.4. Complete documentation 10 11
4. Coding 35 7
5. Testing 3 4

Total Number of Hours= 60days* 5 hours

= 300 hrs.

PERT Process

18
Software and Hardware Requirement Specification

Hardware: -
 Intel Pentium III processor
 Minimum 32MB RAM
 Recommended 256 MB RAM
 Minimum hard disk 2GB

Software: -
 Windows operating system
 C complier compatible with the Windows OS

19
SYSTEM DESIGN

In the system design process, the primary objective is to identify user requirements
and to build a system that satisfies these requirements. Basically, the design phase
concentrates on “how” the system is developed. Design describes a final system and
the process by which it is developed. It refers to the technical specification that will
apply in implementing the candidate system. The design phase is the second
important steps in the system development life cycle. During this phase the analyst
does the following:
 Schedules design activities.
 Works with the user to determine the different data inputs to the system.
 Draws the model of new system, using data flow diagram & entity-
relationship diagrams.
 Defines the data requirements with a data dictionary.
 Writes program specifications.

Identifies and orders any hardware and software that the system design phase would
need.

20
DATA FLOW DIAGRAMS

Data flow diagrams provide a logical model of the system and show the flow of data and
the flow of logic involved. The Data Flow Diagram (DFD) clarifies system requirements
and identifies major transformations that will become programs in system design. With
only four symbols, you can use data flow diagrams to represent both physical and logical
information systems. Data flow diagrams (DFD’s) are not as good as flowcharts for not
very useful for depicting purely logical information flows. In fact, flowcharting has been
criticized by proponents of structured analysis and structured design because it is too
physically oriented. Data flow diagram shows how data travels from one point to another
point in the diagram. The flow is shown as an arrowed line with the arrowhead showing the
direction of flow.
The data flow is given a simple and meaningful descriptive name . The data flow may
move from an external entity to a process, from one process to another process and from
one process to external entity. The Data Flow Diagram (DFD) clarifies system
requirements and identifies major transformations that will become programs in system
design. It is the starting point of system design that decomposes the requirements
specifications down to the lowest level of detail.

21
22
1 LEVEL DFD

23
ENTITY-RELATIONSHIP DIAGRAM

The other tool for problem analysis is the Entity-Relationship Diagram, often called as ER
Diagram. It is a detailed logical representation of the data for an organization and uses
three main constructs, i.e. Data Entities, Relationships and their Associated Attributes.

1. Entities: - An entity is a person, place, thing or event of interest to the organization


and about which data are captured, stored or processed. For example, an employee
is an entity.

2. Relationship: - An association of several entities in a entity-relation model is called


relationship.

3. Attributes: Each entity type has a set of attributes associates with it. An attribute is
a property of characteristics of an entity that is of interest to the organization. We
use an initial Capital Letters, followed by Lowercase Letters in naming an attribute

24
E.R.DIAGRAM

s_type An_ sex

anim_age num_of_offspring
species
Species Keeper_nm
Cellid
anim_
history IS-A An_name

Non Endangered
Endangered species
species

25
DATA DICTIONARY

A data dictionary is a set of metadata which contains the definition and representation of
data elements. From the perspective of a database management system, a data dictionary is
a set of table and views which can only be read and never altered.

Most data dictionaries contain different information about the data used in the enterprise. In
terms of the database representation of the data, the data table defines all schema objects
including views, tables, clusters, indexes, sequences, synonyms, procedures, packages,
functions, triggers and many more. This will ensure that all these things follow one
standard defined in the dictionary. The data dictionary also defines how much space has
been allocated for and / or currently in used by all the schema objects.

Simply putting data dictionary (DD) is data about data. It is a Centralized collection of
definitions of all data flowing among functions and to or from data stores. Data dictionary
removes redundancy and inconsistencies. The Data Dictionary for the current system is
given below:

The proposed WILDLIFE CONSERVATION MANAGEMENT SYSTEM is designed in


the next stage following the DFDs and the DD.

26
ZOO_DB1.DAT : ZOO_DB2.DAT

Column name Data length Column name Data Length


type type
anim_history char 50 anim_history char 50

an_name char 30 an_name char 30

keeper_nm char 20
keeper_nm char 20
an_sex char 2
an_sex char 2
anim_age Int 2
anim_age int 2
num_of_offsprings Int 2
num_of_offsprings int 2
cellid Int 4
Cellid int 4
s_type char 20
S_type char 20

27
Tools/Platform, Languages to be used

Operating System :WINDOWS VISTA


Languages :C Programming compatible with OS
BackHand :RDBMS
Application :multi-User Interactive With RDBMS

Data dictionaries should not be confused with data models because the latter usually
include more complex relationships between elements of data.

28
CODING

//Include Header Files


#include <stdio.h> //standard input output
#include <conio.h> //console input output
#include <dos.h> //for all screen related functions
#include <stdlib.h> //for exit function
#include <string.h> //for string related functions

//The name of file which stores the information about the ZOO Animals
#define ZOO_MGMT_FILE_1 "ZOO_DB1.DAT"
#define ZOO_MGMT_FILE_2 "ZOO_DB2.DAT"
#define TEMP_FILE "TEMP.DAT"

#define _OPT_ONE 1
#define _OPT_TWO 2
#define _OPT_THREE 3

#define _CELL_ID_SIZE 4
#define _ANIM_NAME_SIZE 30
#define _ANIM_HIST_SIZE 50
#define _KEEPER_NAME_SIZE 20

struct ZooAnimal
{
char
anim_history[_ANIM_HIST_SIZE],
an_name[_ANIM_NAME_SIZE],
keeper_nm[_KEEPER_NAME_SIZE],
cellid[_CELL_ID_SIZE],
s_type[_KEEPER_NAME_SIZE],
an_sex[_OPT_TWO];

int anim_age,
num_of_offsprings;
};

/*
//All the Function Prototypes
//Actually not required since all the functions are declared before main
void DisplayMainMenu(void);
void DisplayWildMgmtSystemMenu(void);

29
void ExitTheSystem(void);
void AddAnimal2DB(FILE *fp);
void DisplayAnimalInfo(FILE *fp, int iUserMenuChoice);
void ModifyAnimalInfo(FILE *fp);
void DeleteAnimalInfo(FILE *fp, int iUserMenuChoice);
*/

//================================================================
=============
//Function Name DisplayMainMenu()
//
//Description This function Displays the main menu
//
//Parameter NONE
//
//================================================================
=============
void DisplayMainMenu(void)
{
clrscr();
/* To Display Main menu */
gotoxy(26,40);
textcolor(9);
cprintf("WILDLIFE CONSERVATION MANAGEMENT SYSTEM ");
gotoxy(8,45);
textcolor(9);
/* To Display date and time */
cprintf("DATE : %s ",__DATE__);
gotoxy(55,45);
textcolor(9);
cprintf("TIME : %s ",__TIME__);
gotoxy(30,8);
textcolor(9);
/* Main menu */
cprintf("WILDLIFE CONSERVATION MANAGEMENT SYSTEM");
gotoxy(30,10);
textcolor(19);
cprintf("1.ENDANGERED SPECIES CONSERVATION SYSTEM");
gotoxy(30,12);
cprintf("2.NON ENDANGERED SPECIES SUPPORT SYSTEM");
gotoxy(30,14);
cprintf("3.EXIT");
} //DisplayMainMenu

//================================================================
=============

30
//Function Name DisplayWildMgmtSystemMenu()
//
//Description This function display the operation of Wild Mgmt System
//
//Parameter NONE
//
//================================================================
=============
void DisplayWildMgmtSystemMenu(void)
{
gotoxy(23,42);
textcolor(19);
cprintf("WILDLIFE CONSERVATION MANAGEMENT SYSTEM");
gotoxy(8,45);
textcolor(4);
cprintf("DATE : %s ",__DATE__);
gotoxy(55,45);
cprintf("TIME : %s ",__TIME__);
gotoxy(30,10);
textcolor(19);
cprintf("1.ADD ");
gotoxy(30,12);
cprintf("2.DISPLAY");
gotoxy(30,14);
cprintf("3.MODIFY");
gotoxy(30,16);
cprintf("4.DELETE");
gotoxy(30,18);
cprintf("5.EXIT");
} //DisplayWildMgmtSystemMenu

//================================================================
=============
//Function Name ExitTheSystem()
//
//Description This function simply exit the system using exit function
//
//Parameter NONE
//
//================================================================
=============
void ExitTheSystem(void)
{
/* To exit from the system */
gotoxy(30,28);
textcolor(4);

31
cprintf("SYSTEM SHUTTING DOWN");
sleep(3);
gotoxy(8,42);
printf("WILDLIFE CONSERVATION MANAGEMENT SYSTEM");
exit(0);
} //ExitTheSystem

//================================================================
=============
//Function Name AddAnimal2DB()
//
//Description This function add the animal info to file
//
//Parameter File Pointer
//
//================================================================
=============
void AddAnimal2DB(FILE *fp)
{
struct ZooAnimal animal_info;
int record_size = sizeof(animal_info);
char cell_id[_CELL_ID_SIZE] = {0}; //init with null
int isvalid = 0;

//To add a record


LBL_CELL_ID:
printf("\n\n\n\t\tENTER CELL ID( 3 DIGIT NO.): ");
scanf("%3s",cell_id);
rewind(fp);

//Checking for unique id


while(fread(&animal_info, record_size, 1, fp)==1)
{
if(strcmp(animal_info.cellid,cell_id)==0)
{
textcolor(4);
printf("\n\t\tTHE CELL ID ALREADY EXISTS!!!!!\n");
goto LBL_CELL_ID;
} //ig
} //while

if (fread(&animal_info,record_size,1,fp)==0)
{
//Take the File Pointer to the end of the file
fseek (fp,0,SEEK_END);

32
//Copy the Input cell id to animal info
strcpy(animal_info.cellid,cell_id);

LBL_KEEPER_NAME:
printf("\n\t\tENTER KEEPER'S NAME: ");
scanf("%s",animal_info.keeper_nm);

LBL_ANML_NAME:
printf("\n\t\tENTER ANIMAL NAME : ");
scanf("%s",animal_info.an_name);
if(strlen(animal_info.an_name)>30 || strlen(animal_info.an_name)<3)
goto LBL_ANML_NAME;
LBL_S_TYPE:
printf("\n\t\tENTER SPECIES TYPE : ");
scanf("%s",animal_info.s_type);
if(strlen(animal_info.s_type)>20 || strlen(animal_info.s_type)<3)
goto LBL_S_TYPE;

LBL_ANML_SEX:

while (isvalid != 1)
{
char dump;
printf("\n\t\tENTER SEX [M/F] : ");
isvalid = scanf("%[M,F,m,f]", animal_info.an_sex);

while((dump = getchar()) != '\n' && dump != EOF)


{
}
}
// if(strlen(animal_info.an_sex)>1)
// goto LBL_ANML_SEX;

LBL_ANML_AGE:
printf("\n\t\tENTER ANIMAL AGE : ");
scanf("%d",&animal_info.anim_age);
if(animal_info.anim_age<0||animal_info.anim_age>100)
goto LBL_ANML_AGE;

LBL_ANML_CHILD:
printf("\n\t\tENTER NO. OF OFFSPRING: ");
scanf("%d",&animal_info.num_of_offsprings);

33
LBL_ANML_DETAILS:
printf("\n\t\tANIMAL DETAILS(IF ANY)\n\t\t(Don't leave space,use '_'): ");
scanf("%s",animal_info.anim_history);
if(strlen(animal_info.anim_history)>50)
goto LBL_ANML_DETAILS;

//Write the input information to the file


fwrite(&animal_info,record_size,1,fp);

/*Flushes a stream On success returns 0 , On error returns EOF */


fflush(stdin);
} //if
} //AddAnimal2DB

//================================================================
=============
//Function Name DisplayAnimalInfo()
//
//Description This function display the animal info from the file
//
//Parameter File Pointer and user choice
//
//================================================================
=============
void DisplayAnimalInfo(FILE *fp, int iUserMenuChoice)
{
struct ZooAnimal animal_info;
int record_size = sizeof(animal_info);
char cell_id[_CELL_ID_SIZE] = {0}; //init with null
int isExists = 0;

//Searching and displaying all the information by id


textcolor(7);
printf("\n\n\n\t\tENTER CELL ID: ");
scanf("%s",cell_id);
rewind(fp);

while(fread(&animal_info,record_size,1,fp)!=0)
{
if(strcmp(animal_info.cellid,cell_id)==0)
{
isExists = 1;
clrscr();

//Display according to Main menu


gotoxy(0,20);

34
//ENDANGERED SPECIES CONSERVATION CONSERVATION
if(iUserMenuChoice == _OPT_ONE)
{
printf("\n\n\n\t\tDETAILS OF ANIMAL/BIRD:%s",strupr(animal_info.an_name));
printf("\n__________________________________________________________________
___\n\n");
printf("\n\n CELL ID : %s\n KEEPER's NAME : %s\n ANIMAL's NAME : %s\nSPECIES
TYPE:%s\n ANIMAL's SEX: %s\n ANIMAL's AGE : %d \n OFFSPRING NO. : %d\n\n
ANIMAL/BIRD DETAILS: %s",
strupr(animal_info.cellid),strupr(animal_info.keeper_nm),strupr(animal_info.an_name),str
upr(animal_info.s_type),strupr(animal_info.an_sex),animal_info.anim_age,animal_info.nu
m_of_offsprings,strupr(animal_info.anim_history));
printf("\n__________________________________________________________________
___\n\n");
}
//NON ENDANGERED SPECIES SUPPORT SYSTEM
else if(iUserMenuChoice == _OPT_TWO)
{
printf("\n\n\n\t\tDETAILS OF ANIMAL/BIRD:%s",strupr(animal_info.an_name));
printf("\n__________________________________________________________________
___\n\n");
printf("\n\n NAME : %s\t\n\n CELL ID : %s\tSPECIES TYPE :%s\t\n\n KEEPER'S
NAME : %s\n\n AGE: %d\t \n\nSEX : %s \t \n\nOFFSPRING NO. : %d\n\n ANIMAL
DETAILS: %s",
strupr(animal_info.an_name),strupr(animal_info.s_type),strupr(animal_info.cellid),strupr(a
nimal_info.keeper_nm),animal_info.anim_age,strupr(animal_info.an_sex),animal_info.nu
m_of_offsprings,strupr(animal_info.anim_history));
printf("\n__________________________________________________________________
___\n\n");
} //else-if
} //if
} //while

if (isExists == 0)
{
printf("\n\t\tRECORD DOESN'T EXISTS..");
} //if

getch();
} //DisplayAnimalInfo

//================================================================
=============
//Function Name ModifyAnimalInfo()
//

35
//Description This function updates the animal info in the file
//
//Parameter File Pointer
//
//================================================================
=============
void ModifyAnimalInfo(FILE *fp)
{
struct ZooAnimal animal_info;
int record_size = sizeof(animal_info);
char cell_id[_CELL_ID_SIZE] = {0}; //init with null
char cAns = 'y';

//Searching and modifying Records by id


while(cAns == 'y' || cAns == 'Y')
{
printf("\n\n\n\t\tENTER CELL ID: ");
scanf("%s", cell_id);
rewind(fp);

while(fread(&animal_info, record_size, 1, fp)==1)


{
if(strcmp(animal_info.cellid, cell_id)==0)
{
LBL_ANML_NAME:
printf("\n\n\t\tENTER ANIMAL NAME: %s : ",strupr(animal_info.an_name));
scanf("%s",animal_info.an_name);
if(strlen(animal_info.an_name)>20||strlen(animal_info.an_name)<3)
goto LBL_ANML_NAME;

LBL_S_TYPE:
printf("\n\t\tENTER SPECIES TYPE : ");
scanf("%s",animal_info.s_type);
if(strlen(animal_info.s_type)>20 || strlen(animal_info.s_type)<3)
goto LBL_S_TYPE;
LBL_ANML_SEX:

while (isvalid != 1)
{
char dump;
printf("\n\t\tENTER SEX [M/F] : ");
isvalid = scanf("%[M,F,m,f]", animal_info.an_sex);

while((dump = getchar()) != '\n' && dump != EOF)


{

36
}
}
// if(strlen(animal_info.an_sex)>1)
// goto LBL_ANML_SEX;

LBL_ANML_AGE:
printf(" \n\t\tENTER AGE: %d : " ,animal_info.anim_age);
scanf("%d",&animal_info.anim_age);
if(animal_info.anim_age<1||animal_info.anim_age>100)
goto LBL_ANML_AGE;

LBL_ANML_CHILD:
printf(" \n\t\tENTER NO. OF OFFSPRING: %d :",animal_info.num_of_offsprings);
scanf("%d",&animal_info.num_of_offsprings);

LBL_ANML_DETAILS:
printf("\n\t\tANIMAL DETAILS( if ANY )\n\t\t(Dont leave space,use'_'instead)': %s :
",animal_info.anim_history);
scanf("%s",animal_info.anim_history);
if(strlen(animal_info.anim_history)>50)
goto LBL_ANML_DETAILS;

fseek(fp,-record_size,SEEK_CUR); //Repositions the file pointer of a stream

//Write the input information to the file at current location


fwrite(&animal_info,record_size,1,fp);
printf("\n\t\tRECORD MODIFIED ");
break;
} //if
} //while

printf("\n\n\n\t\tDO U WANT TO MODIFY ANY OTHER RECORD[y/n]");


/*Flushes a stream On success returns 0 , On error returns EOF */
fflush(stdin);
cAns=getche();
} //while
} //ModifyAnimalInfo

//================================================================
=============
//Function Name DeleteAnimalInfo()
//
//Description This function deletes the animal info from the file

37
//
//Parameter File Pointer
//
//================================================================
=============
void DeleteAnimalInfo(FILE *fp, int iUserMenuChoice)
{
struct ZooAnimal animal_info;
int record_size = sizeof(animal_info);
char cell_id[_CELL_ID_SIZE] = {0}; //init with null
int isExists = 0;
char cAns = 'y';
FILE *ft = NULL;

//Searching and Delete Records by id


while(cAns == 'y' || cAns == 'Y')
{
printf("\n\n\t\tENTER CELL ID TO delete RECORD : ");
scanf("%s",cell_id);

//Open Temp File in write mode


ft=fopen(TEMP_FILE,"wb");

//Repositions file pointer to stream's beginning


rewind(fp);
while(fread(&animal_info,record_size,1,fp)!=0)
{
if(strcmp(animal_info.cellid,cell_id)!=0)
{
fwrite(&animal_info,record_size,1,ft);
}
else
{
isExists = 1;
printf("\n\n\t\t RECORD DELETED SUCCESSFULLY");
} //else-if
} //while

if (isExists != 1)
{
isExists = 0;
printf("\n\n\t\t NO SUCH RECORD FOUND");
} //if

//Close the Files


fclose(fp);

38
fclose(ft);

//ENDANGERED SPECIES CONSERVATION CONSERVATION


if(iUserMenuChoice == _OPT_ONE)
{
remove(ZOO_MGMT_FILE_1);
rename(TEMP_FILE,ZOO_MGMT_FILE_1);

fp=fopen(ZOO_MGMT_FILE_1,"rb+");
}
//NON ENDANGERED SPECIES SUPPORT SYSTEM
else if(iUserMenuChoice == _OPT_TWO)
{
remove(ZOO_MGMT_FILE_2);
rename(TEMP_FILE,ZOO_MGMT_FILE_2);

fp=fopen(ZOO_MGMT_FILE_2,"rb+");
} //if

printf("\n\n\t\tDO U WANT TO delete ANOTHER RECORD[y/n]");

fflush(stdin);
cAns=getche();
} //while
} //DeleteAnimalInfo

//================================================================
=============
//Function Name main()
//
//Description This function is main function where execution starts
//
//Parameter NONE
//
//================================================================
=============
void main()
{
int iUserMenuChoice = 0;

LBL_DISPLAY_MENU:
DisplayMainMenu();

cprintf("PLEASE ENTER YOUR CHOICE:");


scanf("%d",&iUserMenuChoice);

39
//If user chose to exit
if(iUserMenuChoice > _OPT_THREE || iUserMenuChoice < _OPT_ONE)
{
printf("\n You have entered wrong choice ! Press any key to continue...");
getch();
goto LBL_DISPLAY_MENU;
}
else if(iUserMenuChoice == _OPT_THREE)
{
ExitTheSystem();
}
else
{
FILE *fp, *fp_opt1, *fp_opt2;
char cChoice;

//Open the File for ENDANGERED SPECIES


fp_opt1 = fopen(ZOO_MGMT_FILE_1,"rb+");
if(fp_opt1==NULL)
{
fp_opt1=fopen(ZOO_MGMT_FILE_1,"wb+");
if(fp_opt1==NULL)
{
puts("\n\t\tCannot Open file");
//exit();
} //if
} //if

//Open the File for NON-ENDANGERED SPECIES


fp_opt2 = fopen(ZOO_MGMT_FILE_2,"rb+");
if(fp_opt2==NULL)
{
fp_opt2=fopen(ZOO_MGMT_FILE_2,"wb+");
if(fp_opt2==NULL)
{
puts("\n\t\tCannot Open file");
//exit();
} //if
} //if

while(1)
{
clrscr();
textcolor(4);
if(iUserMenuChoice == _OPT_ONE)
{

40
gotoxy(30,8);
textcolor(4);
cprintf("ENDANGERED SPECIES MENU");
fp = fp_opt1;
}
else if(iUserMenuChoice == _OPT_TWO)
{
gotoxy(30,8);
textcolor(4);
cprintf("NON ENDANGERED SPECIES MENU");
fp = fp_opt2;
} //else-if

DisplayWildMgmtSystemMenu();
cprintf("SELECT YOUR OPTION: ");
fflush(stdin);
cChoice=getche();
clrscr();
gotoxy(25,8);
textcolor(5);
switch(cChoice)
{
case '1':
AddAnimal2DB(fp);
break;

case '2':
DisplayAnimalInfo(fp, iUserMenuChoice);
break;

case '3':
ModifyAnimalInfo(fp);
break;

case '4':
DeleteAnimalInfo(fp, iUserMenuChoice);
break;

case '5':
fclose(fp);
goto LBL_DISPLAY_MENU;
} //switch - user choice
} //while - infinite loop
} //else-if
} //main

41
42
43
44
45
46
47
48
SYSTEM TESTING

System testing is a process of executing a program to locate an error. Testing is the


verification and validation activity for the software product. It involves checking processes,
such as inspection and reviews, at each stage of the software process from user
requirements definition to program development. During system testing, the system is used
experimentally to ensure that the software does not fail, i.e. it will run according to its
specification and in the way users expect to it.
Testing is a four stage process where system components are tested, and the integrated
system is tested and finally the system is tested with the item data. The four types of testing
are as follows:

UNIT
TESTING

INTEGRATION
TESTING

SYSTEM
TESTING

49

ACCEPTANCE
Figure 10.1: - Testing Process

50
The following are the stages in testing process:
 Unit Testing: -
Unit testing is a method of testing that verifies the individual units of source code are
working properly. A unit is the smallest testable part of an application. Using
component level design description as a guide, important control paths are tested to
uncover errors within the boundary of the module. Tests of data flow across a module
interface were carried out for each module of the software. I.e. unit testing ensures
that functions or procedures are operating correctly. Each component is tested
individually.

 Black Box Testing: - Black box testing takes an external perspective of the test
object to derive test cases. These tests can be functional or non-functional, though
usually functional. The test designer selects valid and invalid inputs and
determines the correct output. There is no knowledge of the test object's internal
structure.

Figure 10.2: - Black box testing diagram

 White Box Testing: - White box uses an internal perspective of the system to
design test cases based on internal structure. It requires programming skills to
identify all paths through the software. The tester chooses test case inputs to
exercise paths through the code and determines the appropriate outputs. In
electrical hardware testing, every node in a circuit may be probed and measured.
While white box testing is applicable at the unit, integration and system levels of
the software testing process, it is typically applied to the unit. While it normally
tests paths within a unit, it can also test paths between units during integration,
and between subsystems during a system level test. Though this method of test
design can uncover an overwhelming number of test cases, it might not detect
unimplemented parts of the specification or missing requirements, but one can be
sure that all paths through the test object are executed.
 Integration Testing: -
Integration testing is a process of combining multiple modules systematically for
conducting tests in order to find errors in the interface between modules. The goal
here is to see if the modules can be integrated properly. Hence, the emphasis is on
testing the interfaces between modules. The integration testing follows the following
strategies: -

51
 Incremental strategy.
 Non-incremental strategy.
 Mixed strategy.

 System Testing: - In the system testing, the entire software system is tested.
The reference document for this purpose is the requirements document, and the
objective is to see if the software meets its requirements. A number of different
types of testing are used at this stage. They are follows:

o Functional Testing: - It is concerned with functionality rather than


the implementation of the program. In functional testing the structure
of the program is not considered.

o Performance Testing: - It deals with quality related issues like


security test, reliability test etc. System testing is done by the
developers and before the product is given to user for use.

 Acceptance Testing: - After the system testing is completed successfully by


the developers. Acceptance testing is done at the user end. It is the user who now
designs the test cases. Acceptance testing is performed with realistic data of the
client to demonstrate that is software is working satisfactory.

52
IMPLEMENTATION
System implementation is the final stage of development. It consists of installing
hardware, programs, collecting data and organizing people to interact with and run
the system.
In the implementation phase, user actually starts using the system. This phase
therefore involves training the users for using the system and also providing them
documentation to refer to.
Implementation can be done in two ways. One way is by implementing the new
system along with the old system and makes them run in parallel. The other method is
to replace the entire system. In large organizations, the new system can be
implemented in certain areas as a pilot project and if satisfactory results are obtained,
it can be implemented to other areas also.

53
CONCLUSION

This software is a database project with all the basic capabilities a database should
have. This application software is about managing the records of the animals and their
daily requirements. Records of the animals in park are saved in separate files and can
be used to locate any information about any particular animal. The objective of the
project is to perform all the functions or operations accurately.

54
SCOPE OF THE PROJECT

The proposed system can manage all drawbacks of the existing manual system. The
system has a user friendly environment where the end user can perform all the
activity. Even if the user has little knowledge of computers he/she can easily operate.
The system proposed can easily be installed in any shop.
The system has the following objectives to be achieved
 User Friendly Environment.
 Less Space.
 Fast Retrieval.
 Easy to Operate.
 Accuracy.
 Cost Reduction.

55
REFERENCES
WEB REFERENCES

 http://google.com

BOOKS REFERENCES
 ANSI C by E Balagurusamy Tata Mc Graw Hill India.

 BOOK: ANSI in Turbo C


AUTHOR: Robert Lafore
PUBLISHER: Galgotia Publications pvt. Ltd.

56
57
58
59
60
61

You might also like