Sie sind auf Seite 1von 15

SETH ANANDRAM JAIPURIA SCHOOL

Practical FILE

TOPIC : - BIOCOP
NAME:- CHAITANYA BATRA
CLASS :- XII-A
BOARD ROLL NO.

INDEX
1)
2)
3)
4)
5)
6)
7)
8)

Certificate
Acknowledgement
System requirements
Header files used
Functions used
Source code
Output Screens
Bibliography

CERTIFICATE
This is to certify that Chaitanya Batra of
class XII-A has completed the project work
entitled on BIOCOP under the guidance of
Mrs. Deepa Sharma.
The progress of the project has been
continuously reported and has been
acknowledged consistently.

..................................
Signature
(Computer Science Teacher)

ACKNOWLEGDEMENT

On the completion of my project work on


BIOCOP. I grateful thank my computer science
teacher Mrs. Deepa Sharma for her constant
help and guidance to me without whom this
project would not have been success.

SYSTEM REQuIREMENTS

HARDWARE REQUIREMENTS
Pentium III 2.71 Ghz
RAM 128 MB
HARD DISC 2.1 GB
PRINTER
SOFTWARE REQUIREMENTS
Operating SystemDOS
Window 98/XP/7

HEADER FILES USED

1) #include<iostream.h> - used for input/output operations us


in cin,cout functions
2) #include<conio.h>
- contains functions like
clrscr(),cputs(),getch()
3) #include<stdio.h>
- used for input/output using
gets,puts functions.

4) #include<fstream.h>

- includes the definitions for the


stream classes ifstream, ofstream
and fstream

5) #include<process.h>

- contains function declarations and


macros used in working with threads
and processes

FUNCTIONS USED

1) class biocop
- class used in project
2) fstream fp; biocop b; - global declaration for stream object, object
3) void write_disease() - function to write in file
4) void display_all()
- function to read all records from file
5) void display_sp(int n) - function to read specific record from file
6) void modify_disease() - function to modify record of file
7) void delete_disease() - function to delete record of file
8) void menu()
- function to display all products price list
9) void intro()
- introduction function
10) void admin_menu() - adminstrator menu function
11) void main()
- the main function of program

SOURCE CODE
//***************************************************************
//
HEADER FILE USED IN PROJECT
//****************************************************************
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<fstream.h>
//***************************************************************
//
CLASS USED IN PROJECT
//****************************************************************
class biocop
{
int dno;
char dname[50], symptoms[100];
public:
void create_disease()
{
cout<<"\nPlease Enter The DISEASE No. ";
cin>>dno;
cout<<"\n\nPlease Enter The Name of The DISEASE ";
gets(dname);
cout<<"\n\nPlease Enter the symptoms ";
gets(symptoms);
}
void show_disease()
{
cout<<"\nThe Disease No. : "<<dno;
cout<<"\nThe Name of The Disease : ";
puts(dname);
cout<<"\nThe Symptoms of The Disease :";
puts(symptoms);
}
int retdno()
{return dno;}
char* retdname()
{return dname;}
char* retsymptoms()
{return symptoms;}

};

//class ends here

//***************************************************************
//
global declaration for stream object, object
//****************************************************************
fstream fp;
biocop b;
//***************************************************************
//
function to write in file
//****************************************************************
void write_disease()
{
fp.open("disease.dat",ios::out|ios::app);
b.create_disease();
fp.write((char*)&b,sizeof(biocop));
fp.close();
cout<<"\n\nThe Record of the Disease Has Been Created ";
getch();
}
//***************************************************************
//
function to read all records from file
//****************************************************************
void display_all()
{
clrscr();
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
fp.open("disease.dat",ios::in);
while(fp.read((char*)&b,sizeof(biocop)))
{
b.show_disease();
cout<<"\n\n====================================\n";
getch();
}
fp.close();
getch();
}
//***************************************************************
//
function to read specific record from file
//****************************************************************
void display_sp(int n)
{
int flag=0;
fp.open("disease.dat",ios::in);
while(fp.read((char*)&b,sizeof(biocop)))

{
if(b.retdno()==n)
{
clrscr();
b.show_disease();
flag=1;
}
}
fp.close();
if(flag==0)
cout<<"\n\nrecord not exist";
getch();
}
//***************************************************************
//
function to modify record of file
//****************************************************************
void modify_disease()
{
int no,found=0;
clrscr();
cout<<"\n\n\tTo Modify ";
cout<<"\n\n\tPlease Enter The disease no.";
cin>>no;
fp.open("disease.dat",ios::in|ios::out);
while(fp.read((char*)&b,sizeof(biocop)) && found==0)
{
if(b.retdno()==no)
{
b.show_disease();
cout<<"\nPlease Enter The New Details of the
disease"<<endl;
b.create_disease();
int pos=-1*sizeof(b);
fp.seekp(pos,ios::cur);
fp.write((char*)&b,sizeof(biocop));
cout<<"\n\n\t Record Updated";
found=1;
}
}
fp.close();
if(found==0)
cout<<"\n\n Record Not Found ";
getch();
}
//***************************************************************
//
function to delete record of file
//****************************************************************
void delete_disease()
{
int no;

clrscr();
cout<<"\n\n\n\tDelete Record";
cout<<"\n\nPlease Enter The disease You Want To Delete";
cin>>no;
fp.open("disease.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);
fp.seekg(0,ios::beg);
while(fp.read((char*)&b,sizeof(biocop)))
{
if(b.retdno()!=no)
{
fp2.write((char*)&b,sizeof(biocop));
}
}
fp2.close();
fp.close();
remove("disease.dat");
rename("Temp.dat","disease.dat");
cout<<"\n\n\tRecord Deleted ..";
getch();
}
//***************************************************************
//
function to display all products price list
//****************************************************************
void menu()
{
clrscr();
fp.open("disease.dat",ios::in);
if(!fp)
{
cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To Admin Menu to
create File";
cout<<"\n\n\n Program is closing ....";
getch();
exit(0);
}
cout<<"\n\n\t\t DISEASE DETAILS\n\n";
cout<<"====================================================\n";
cout<<"Disease no.\t\t Disease Name \t\t Symptoms\n";
cout<<"====================================================\n";
while(fp.read((char*)&b,sizeof(biocop)))
{
cout<<b.retdno()<<"\t\t"<<b.retdname()<<"\t\t"<<b.retsymptoms()<<endl;
}
fp.close();
}
void Membership()
{
int order_arr, quan;

char ch='Y';
menu();
cout<<"\n============================";
cout<<"\n
BE THE MEMBER";
cout<<"\n============================\n";
do{
cout<<"\n\nEnter The Disease no. for which you want to a check
up : ";
cin>>order_arr;
cout<<"\n TIMINGS : ";
cin>>quan;
cout<<"\n\nThank You For Associating with us";
cout<<"\nDo You Want a check up for another disease ? (y/n)";
cin>>ch;
}while(ch=='y' ||ch=='Y');
getch();
}

//***************************************************************
//
INTRODUCTION FUNCTION
//****************************************************************
void intro()
{
clrscr();
gotoxy(31,11);
cout<<"COMPUTER SCIENCE PROJECT";
gotoxy(35,14);
cout<<"BIOCOP- DISEASE & ITS SYMPTOMS";
gotoxy(35,17);
cout<<"\n\nMADE BY : Chaitanya Batra (XII A);
cout<<"\n\nSCHOOL : Seth Anandram Jaipuria School";
getch();
}

//***************************************************************
//
ADMINSTRATOR MENU FUNCTION
//****************************************************************
void admin_menu()
{
clrscr();
char ch2;
cout<<"\n\n\n\tADMIN ";
cout<<"\n\n\t1.CREATE DISEASE";
cout<<"\n\n\t2.DISPLAY ALL DISEASES";
cout<<"\n\n\t3.QUERY ";
cout<<"\n\n\t4.MODIFY DISEASE";
cout<<"\n\n\t5.DELETE DISEASE";
cout<<"\n\n\t6.VIEW DISEASE DETAILS";
cout<<"\n\n\t7.BACK TO MAIN ";
cout<<"\n\n\tPlease Enter Your Choice (1-7) ";
ch2=getche();

switch(ch2)
{
case '1': clrscr();
write_disease();
break;
case '2': display_all();break;
case '3':
int num;
clrscr();
cout<<"\n\n\tPlease Enter The Disease No. ";
cin>>num;
display_sp(num);
break;
case '4': modify_disease();break;
case '5': delete_disease();break;
case '6': menu();
getch();
case '7': break;
default:cout<<"\a";admin_menu();
}
}
//***************************************************************
//
THE MAIN FUNCTION OF PROGRAM
//****************************************************************
void main()
{
char ch;
intro();
do
{
clrscr();
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. USER";
cout<<"\n\n\t02. ADMINISTRATOR";
cout<<"\n\n\t03. EXIT";
cout<<"\n\n\tPlease Select Your Option (1-3) ";
ch=getche();
switch(ch)
{
case '1':
Membership();
getch();
break;
case '2': admin_menu();
break;
case '3':exit(0);
default :cout<<"\a";
}
}while(ch!='3');
}
//***************************************************************
//
END OF PROJECT
//***************************************************************

BIOCOP
The set of the objectives that the software caters to, are as stated
below:

Electronic handling of admission details to enhance the


accuracy, flexibility, reliability and to remove the human
errors.
To permit user to enter in a disciplined, organized and userinteractive environment at random and to permit easy
retrieval of any information

To provide an efficient, accurate, reliable, fast, and robust


structure that can handle any number of new entries.

BIBLIOGRAPHY

1) Computer Science with C++ - Sumita


Arora
2) C++ Standard Library Tutorial And
Reference- Nicolai Josuttis
3) C++ Concurrency In action- Anthony
Williams
4) Wikipedia.com

Das könnte Ihnen auch gefallen