Você está na página 1de 86

#include<fstream.

h>

#include<conio.h>

#include<stdio.h>

#include<process.h>

#include<string.h>

#include<iomanip.h>

#include<graphics.h>

#include<math.h>

#include<dos.h>

//***************************************************************

// CLASS USED IN PROJECT

//****************************************************************

class book

char bno[6];

char bname[50];

char aname[20];

public:

void create_book()

textcolor(10);

gotoxy(15,5);cprintf("***************************************************");

gotoxy(15,7);cprintf("***************************************************");
textcolor(14);

gotoxy(30,6);cprintf("...New Book Entry...");

gotoxy(55,11);cout<<" ";gotoxy(55,13);cout<<" ";gotoxy(55,15);cout<<"


";

//cout<<"\nNEW BOOK ENTRY...\n";

textcolor(15);

gotoxy(27,11);cprintf("Enter The book no.");

cin>>bno;gotoxy(55,11);cout<<bno;

gotoxy(27,13);cprintf("Enter The Name of The Book ");

gets(bname);gotoxy(55,13);cout<<bname;

gotoxy(27,15);cprintf("Enter The Author's Name ");

gets(aname);gotoxy(55,15);cout<<aname;

textcolor(11);gotoxy(15,18);cprintf("*************************************************
**");

textcolor(6);gotoxy(35,20);cprintf("Book Created..");

void show_book()

{
textcolor(10);

textcolor(14);

gotoxy(30,12);cprintf("...Book Information...");
textcolor(15);

gotoxy(33,13);cprintf("Book no. : %s",bno);

gotoxy(33,14);cprintf("Book Name : %s",bname);

gotoxy(33,15);cprintf("Author Name : %s",aname);

void modify_book()

gotoxy(33,18);textcolor(15);cprintf("Book no. : %s",bno);

gotoxy(31,19); cprintf("Modify Book Name :");

gets(bname);

gotoxy(27,20); cprintf("Modify Author's Name of Book : ");

gets(aname);

char* retbno()

return bno;

void report(int ghu)

textcolor(15);

//cout<<"\t"<<admno<<setw(20)<<name<<setw(10)<<token<<endl;
gotoxy(15,ghu);cprintf("%s",bno);

gotoxy(32,ghu);cprintf("%s",bname);

gotoxy(52,ghu);cprintf("%s",aname);

//cout<<bno<<setw(30)<<bname<<setw(30)<<aname<<endl;}

}; //class ends here

class student

char admno[6];

char name[20];

char stbno[6];

int token;

public:

void create_student()

{
//clrscr();

textcolor(11);

gotoxy(15,5);cprintf("***************************************************");

gotoxy(15,7);cprintf("***************************************************");

textcolor(14);

gotoxy(27,6);cprintf("...New Student`s Entry...");

gotoxy(50,12);cout<<" ";

gotoxy(58,14);cout<<" ";

//cout<<"\nNEW STUDENT ENTRY...\n";

textcolor(15);

gotoxy(27,12);cprintf("Enter The admission no.");

cin>>admno;gotoxy(50,12);cout<<admno;

gotoxy(27,14);cprintf("Enter The Name of The Student");

gets(name);gotoxy(58,14);cout<<name;

token=0;

stbno[0]='/0';

textcolor(12);

gotoxy(25,19);cprintf("Success!!! Student Record Created..");

void show_student(int f)

{ textcolor(15);
gotoxy(30,f);cprintf("Admission no. : %s",admno);

gotoxy(30,f+1);cprintf("Student Name : %s",name);

gotoxy(30,f+2);cprintf("No of Book issued : %i",token);

if(token==1)

{gotoxy(30,f+3);cprintf("Book No : %s",stbno);

void modify_student()

gotoxy(30,19);textcolor(15);cprintf("Admission no. : %s",admno);

gotoxy(30,20);cprintf("Modify Student Name : ");

gets(name);gotoxy(52,20);cout<<name;

char* retadmno()

return admno;

char* retstbno()

return stbno;

}
int rettoken()

return token;

void addtoken()

{token=1;}

void resettoken()

{token=0;}

void getstbno(char t[])

strcpy(stbno,t);

void report(int ghu)

textcolor(15);

//cout<<"\t"<<admno<<setw(20)<<name<<setw(10)<<token<<endl;

gotoxy(18,ghu);cprintf("%s",admno);

gotoxy(40,ghu);cprintf("%s",name);

gotoxy(65,ghu);cprintf("%i",token);

}
}; //class ends here

//***************************************************************

// global declaration for stream object, object

//****************************************************************

fstream fp,fp1;

book bk;

student st;

//***************************************************************

// function to write in file

//****************************************************************

void write_book()

char ch;

textbackground(0);

textmode(C80);
//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");
gotoxy(80,g11);cprintf("");

fp.open("book.dat",ios::out|ios::app);

do

bk.create_book();

fp.write((char*)&bk,sizeof(book));

gotoxy(25,22);textcolor(14+BLINK);cprintf("Do you want to add more record..(y/n?)");

cin>>ch;

}while(ch=='y'||ch=='Y');

fp.close();

void write_student()

{
textbackground(0);

textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);


gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

char ch;

fp.open("student.dat",ios::out|ios::app);

do

st.create_student();

fp.write((char*)&st,sizeof(student));

gotoxy(15,19);textcolor(13);cprintf("*************************************************
****");

gotoxy(25,21);textcolor(14+BLINK);cprintf("Do you wish to add more records ?");

cin>>ch;

}while(ch=='y'||ch=='Y');

fp.close();

}
//***************************************************************

// function to read specific record from file

//****************************************************************

void display_spb(char n[],int yupu)

//cout<<"\nBOOK DETAILS\n";

int flag=0;

fp.open("book.dat",ios::in);

while(fp.read((char*)&bk,sizeof(book)))

if(strcmpi(bk.retbno(),n)==0)

bk.show_book();

flag=1;

fp.close();

if(flag==0)

{ gotoxy(25,15);textcolor(14+BLINK);cprintf("Book does not exist");}

getch();

}
void display_sps(char n[])

textcolor(13);

gotoxy(12,11);cprintf("************************************************************
***");

gotoxy(12,9);cprintf("*************************************************************
**");

textcolor(14);

gotoxy(30,10);cprintf("...Student`s Details...");

int flag=0;

fp.open("student.dat",ios::in);

while(fp.read((char*)&st,sizeof(student)))

if((strcmpi(st.retadmno(),n)==0))

st.show_student(14);

flag=1;

fp.close();

if(flag==0)
{ gotoxy(35,15);textcolor(14+BLINK);cprintf("Student does not exist"); }

getch();

//***************************************************************

// function to modify record of file

//****************************************************************

void modify_book()

char n[6];

int found=0;

//clrscr();

//cout<<"\n\n\tMODIFY BOOK REOCORD.... ";

gotoxy(25,10);textcolor(14);cprintf("Enter The book no. of The book");

cin>>n;gotoxy(56,10);cout<<n;

fp.open("book.dat",ios::in|ios::out);

while(fp.read((char*)&bk,sizeof(book)) && found==0)

if(strcmpi(bk.retbno(),n)==0)

bk.show_book();

gotoxy(25,17);textcolor(14);cprintf("Enter the new details of book");


bk.modify_book();

int pos=-1*sizeof(bk);

fp.seekp(pos,ios::cur);

fp.write((char*)&bk,sizeof(book));

gotoxy(35,22);textcolor(13+BLINK);cprintf("Record Updated");

found=1;

fp.close();

if(found==0)

{gotoxy(35,15);textcolor(13+BLINK);cprintf("Record Not Found ");}

getch();

void modify_student()

char n[6];

int found=0;

textcolor(11);

gotoxy(12,3);cprintf("*************************************************************
**");

gotoxy(12,5);cprintf("*************************************************************
**");
textcolor(12);

gotoxy(25,4);cprintf("...Modify Student`s Record...");

//cout<<"\n\n\tMODIFY STUDENT RECORD... ";

gotoxy(20,7);textcolor(14);cprintf("Enter the admission no. of the student");

cin>>n;gotoxy(59,7);cout<<n;

fp.open("student.dat",ios::in|ios::out);

while(fp.read((char*)&st,sizeof(student)) && found==0)

if(strcmpi(st.retadmno(),n)==0)

textcolor(12);

gotoxy(25,10);cprintf("...Previous Details of Student...");

st.show_student(12);

textcolor(12);

gotoxy(30,17);cprintf("...New Details of Student...");

//cout<<"\nEnter The New Details of student"<<endl;

st.modify_student();

int pos=-1*sizeof(st);
fp.seekp(pos,ios::cur);

fp.write((char*)&st,sizeof(student));

gotoxy(35,22);textcolor(13+BLINK);cprintf("Record Updated");

found=1;

fp.close();

if(found==0)

{gotoxy(35,15);textcolor(14+BLINK);cprintf("Record Not Found "); }

getch();

//***************************************************************

// function to delete record of file

//****************************************************************

void delete_student()

char n[6];

int flag=0;

//clrscr();

textbackground(0);
textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);


gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

textcolor(15);

gotoxy(12,9);cprintf("*************************************************************
**");

gotoxy(12,7);cprintf("*************************************************************
**");

textcolor(12);

gotoxy(30,8);cprintf("...Delete Record...");

//cout<<"\n\n\n\tDELETE STUDENT...";

gotoxy(10,12);textcolor(10);cprintf("Enter The admission no. of the Student You Want To Delete


: ");

cin>>n;gotoxy(70,12);cout<<n;

fp.open("student.dat",ios::in|ios::out);

fstream fp2;

fp2.open("Temp.dat",ios::out);

fp.seekg(0,ios::beg);

while(fp.read((char*)&st,sizeof(student)))

if(strcmpi(st.retadmno(),n)!=0)

fp2.write((char*)&st,sizeof(student));
else

flag=1;

fp2.close();

fp.close();

remove("student.dat");

rename("Temp.dat","student.dat");

if(flag==1)

{ gotoxy(35,17);textcolor(11+BLINK);cprintf("Record Deleted .."); }

else

{ gotoxy(35,17);textcolor(11+BLINK);cprintf("Record not found"); }

getch();

void delete_book()

char n[6];

textbackground(0);

textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();
for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

}
textcolor(15);

gotoxy(12,4);cprintf("*************************************************************
**");

gotoxy(12,6);cprintf("*************************************************************
**");

textcolor(12);

gotoxy(30,5);cprintf("...Delete Book...");

gotoxy(15,8);textcolor(14);cprintf("Enter the book no. of the book you want to delete : ");

cin>>n;gotoxy(63,8);cout<<n;

fp.open("book.dat",ios::in|ios::out);

fstream fp2;

fp2.open("Temp.dat",ios::out);

fp.seekg(0,ios::beg);

while(fp.read((char*)&bk,sizeof(book)))

if(strcmpi(bk.retbno(),n)!=0)

fp2.write((char*)&bk,sizeof(book));

}
fp2.close();

fp.close();

remove("book.dat");

rename("Temp.dat","book.dat");

gotoxy(35,15);textcolor(13+BLINK);cprintf("Record Deleted ..");

getch();

//***************************************************************

// function to display all students list

//****************************************************************

void display_alls()

clrscr();

textbackground(0);

textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;


clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

}
fp.open("student.dat",ios::in);

if(!fp)

cout<<"ERROR!!! FILE COULD NOT BE OPEN ";

getch();

return;

textcolor(10);

gotoxy(12,9);cprintf("*************************************************************
**");

gotoxy(12,7);cprintf("*************************************************************
**");

textcolor(14);

gotoxy(30,5);cprintf("...Student`s List...");

textcolor(12);gotoxy(15,8);cprintf("Admission No. Name Book(s) Issued");

int rop=12;

while(fp.read((char*)&st,sizeof(student)))

{
st.report(rop);

rop=rop+1;

fp.close();

textcolor(10);

gotoxy(12,rop+2);cprintf("*********************************************************
******");

getch();

//***************************************************************

// function to display Books list

//****************************************************************

void display_allb()

textbackground(0);

textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();
for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

fp.open("book.dat",ios::in);
if(!fp)

cout<<"ERROR!!! FILE COULD NOT BE OPEN ";

getch();

return;

textcolor(11);

gotoxy(10,5);cprintf("*************************************************************
*****");

gotoxy(10,7);cprintf("*************************************************************
*****");

textcolor(10);

gotoxy(15,6);cprintf("Book No. Book Name Author Name");

int lop=8;

while(fp.read((char*)&bk,sizeof(book)))

bk.report(lop);lop=lop+1;

fp.close();

getch();

}
//***************************************************************

// function to issue book

//****************************************************************

void book_issue()

char sn[6],bn[6];

int found=0,flag=0;

textbackground(0);

textmode(C80);

clrscr();

int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

{
if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

textcolor(11);

gotoxy(15,5);cprintf("***************************************************");

gotoxy(15,7);cprintf("***************************************************");

textcolor(10);

gotoxy(32,6);cprintf("...Book Issue...");

textcolor(15);gotoxy(25,9);cprintf("Enter The student's admission no.");

int n67=0;

cin>>sn;
gotoxy(58,9);cout<<sn;

fp.open("student.dat",ios::in|ios::out);

fp1.open("book.dat",ios::in|ios::out);

while(fp.read((char*)&st,sizeof(student)) && found==0)

if(strcmpi(st.retadmno(),sn)==0)

found=1;

if(st.rettoken()==0)

gotoxy(25,10);textcolor(15);cprintf("Enter the book no. ");

cin>>bn;gotoxy(45,10);cout<<bn;

while(fp1.read((char*)&bk,sizeof(book))&& flag==0)

if(strcmpi(bk.retbno(),bn)==0)

bk.show_book();

flag=1;

st.addtoken();

st.getstbno(bk.retbno());

int pos=-1*sizeof(st);

fp.seekp(pos,ios::cur);

fp.write((char*)&st,sizeof(student));

gotoxy(29,17);textcolor(14+BLINK);cprintf("Book issued
successfully");

textcolor(10);
gotoxy(10,19);cprintf("Please Note: Write current date
in backside of book and submit");

gotoxy(10,20);cprintf("within 15 days fine Rs. 1 for each


day after 15 days period");

if(flag==0)

{gotoxy(30,15);textcolor(10+BLINK);cprintf("Book no does not


exist");}

else

{ gotoxy(25,15);textcolor(10+BLINK);cprintf("You have not returned the


last book "); }

if(found==0)

{textcolor(13);gotoxy(25,12);cprintf("Oops!!! Student record not exist...");}

getch();

fp.close();

fp1.close();

//***************************************************************

// function to deposit book

//****************************************************************
void book_deposit()

char sn[6],bn[6];

int found=0,flag=0,day,fine;

textbackground(0);

textmode(C80);

clrscr();

int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);


gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

textcolor(11);

gotoxy(15,5);cprintf("***************************************************");

gotoxy(15,7);cprintf("***************************************************");

textcolor(10);

gotoxy(32,6);cprintf("...Book Deposit ...");

textcolor(15);gotoxy(25,9);cprintf("Enter The student's admission no.");

cin>>sn;

gotoxy(57,9);cout<<sn;
fp.open("student.dat",ios::in|ios::out);

fp1.open("book.dat",ios::in|ios::out);

while(fp.read((char*)&st,sizeof(student)) && found==0)

if(strcmpi(st.retadmno(),sn)==0)

found=1;

if(st.rettoken()==1)

while(fp1.read((char*)&bk,sizeof(book))&& flag==0)

if(strcmpi(bk.retbno(),st.retstbno())==0)

bk.show_book();

flag=1;

gotoxy(25,18);textcolor(10);cprintf("Book deposited in no. of days");

cin>>day;gotoxy(55,18);cout<<day;

if(day>15)

fine=(day-15)*1;

gotoxy(27,20);textcolor(12+BLINK);cprintf("Fine has to be deposited


Rs.%i",fine);

st.resettoken();

int pos=-1*sizeof(st);
fp.seekp(pos,ios::cur);

fp.write((char*)&st,sizeof(student));

gotoxy(27,21);cprintf("Book deposited successfully");

if(flag==0)

{gotoxy(35,15);textcolor(13+BLINK);cprintf("Book no does not exist"); }

else

{ gotoxy(25,15);textcolor(10+BLINK);cprintf("No book is issued..please check!!");}

if(found==0)

{textcolor(13);gotoxy(25,12);cprintf("Oops!!! Student record not exist...");}

getch();

fp.close();

fp1.close();

//***************************************************************
// INTRODUCTION FUNCTION

//****************************************************************

void intro()

{ int dr=9,gm=2;

initgraph( &dr,&gm,"C:\\TURBOC3\\BGI\\" );

settextstyle(4,0,5);

int h=400;

for (int i=1;i<=200;i++)

h=h-1;

char lol[90];

setcolor(10);

settextstyle(4,0,5);

sprintf(lol,"Credits to :");

outtextxy(i-20,80,lol);

char lol1[90],lol3[90],lol2[90];

settextstyle(4,0,3);

setcolor(10);

sprintf(lol1,"Ashwin Sahu,Ankush Khatri");

outtextxy(h,190,lol1);

setcolor(10);
sprintf(lol2,"&");

outtextxy(i+50,210,lol2);

sprintf(lol3,"Harjot Singh");

outtextxy(h,230,lol3);

delay(2);

setcolor(1);

sprintf(lol,"Credits to :");

settextstyle(4,0,5);

outtextxy(i-20,80,lol);

settextstyle(4,0,3);

sprintf(lol2,"&");

outtextxy(i+50,210,lol2);

sprintf(lol1,"Ashwin Sahu,Ankush Khatri");

outtextxy(h,190,lol1);

sprintf(lol3,"Harjot Singh");

outtextxy(h,230,lol3);

char lol[90],lol1[90],lol2[90],lol3[90];

setcolor(10);

sprintf(lol,"Credits to :");

settextstyle(4,0,5);

outtextxy(i-20,80,lol);

settextstyle(4,0,3);

sprintf(lol1,"Ashwin Sahu,Ankush Khatri");

outtextxy(h,190,lol1);
sprintf(lol2,"&");

outtextxy(i+50,210,lol2);

sprintf(lol3,"Harjot Singh");

outtextxy(h,230,lol3);

getch();

for (i=1;i<=700;i++)

setcolor(1);

rectangle(0,0,i,500);

setbkcolor(14);

circle(320,250,400);

setfillstyle(7,12);

floodfill(320,250,6);

int go=2,d=20;

float ji=450,x1,y1;

for (int q1=350 ; q1<450 ; q1=q1+go)

x1=100*sin(q1*3.14/180)+100;

y1=50*cos(q1*3.14/180)+100;

setcolor(6);

ji=ji-2;

line(320,ji,x1,y1);

delay(d);

}
for (q1=270 ; q1>90 ; q1=q1-go)

x1=100*sin(q1*3.14/180)+300;

y1=15*cos(q1*3.14/180)+100;

setcolor(6);

if (ji<450) {ji=ji+2;}

line(320,ji,x1,y1);

delay(d);

for (q1=360 ; q1<450 ; q1=q1+go)

x1=100*sin(q1*3.14/180)+400;

y1=40*cos(q1*3.14/180)+60;

setcolor(6);

line(320,450,x1,y1);

delay(d);

for (q1=270 ; q1<360 ; q1=q1+go)

x1=100*sin(q1*3.14/180)+600;

y1=40*cos(q1*3.14/180)+67;

setcolor(6);

line(320,450,x1,y1);

delay(d);

}
getch();

//***************************************************************

// ADMINISTRATOR MENU FUNCTION

char *l={" "};

void rase()

{for(int p=5;p<=19;p++)

{textbackground(0);

gotoxy(40,p);cout<<l;

char tem[11][40]={ {"1.Create student record."},

{ "2.Display all student record(s)."},

{"3.Display specific student`s record."},

{"4.Modify student`s record."},

{"5.Delete student`s record."},

{"6.Create book."},
{"7.Display all books."},

{"8.Display specific book."},

{"9.Modify book."},

{"10.Delete book."},

{"11.Back to previous menu."}

};

void admin_menu()

{ textbackground(0);

textmode(BW80);

clrscr();

textbackground(0);

textmode(C80);

clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);


gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

}
int a,j,k;float b;char ch;

//clrscr();

gotoxy(15,5);textcolor(13);cprintf("**************************************************
***");

gotoxy(28,6);textcolor(14);cprintf("Program on Library-Management ");

gotoxy(15,7);textcolor(13);cprintf("**************************************************
***");

textcolor(15);

int y=10 ;

for(a=0;a<=10;a++)

{ //gotoxy(25,y);cout<<a+1<<"-> ";

gotoxy(30,y);cprintf(tem[a]);y=y+1;

y=10;gotoxy(30,10);

textbackground(4);

cprintf (tem[0]);

int c;

do

{if(y==10)

{c=0;}

else if (y==11) c=1;

else if (y==12) c=2;

else if (y==13) c=3;

else if (y==14) c=4;


else if (y==15) c=5;

else if (y==16) c=6;

else if (y==17) c=7;

else if (y==18) c=8;

else if (y==19) c=9;

else if (y==20) c=10;

ch=getch();

switch(ch)

{ case 72:if(y<=10)

{ gotoxy(30,10);

textbackground(0);

cprintf (tem [0]);

y=20;gotoxy(30,y);

textbackground(4);

cprintf(tem[10]);

else

{ gotoxy(30,y);

textbackground(0);

cprintf(tem[c]);

y=y-1;c=c-1;gotoxy(30,y);

textbackground(4);

cprintf(tem[c]);

} break;
case 80:if(y>=20)

{ gotoxy(30,20);

textbackground(0);

cprintf(tem[10]);

y=10;gotoxy(30,y);

textbackground(4);

cprintf(tem[0]);

else

{ gotoxy(30,y);

textbackground(0);

cprintf(tem[c]);

y=y+1;c=c+1;gotoxy(30,y);

textbackground(4);

cprintf(tem[c]);

break;

while(ch !=13);

textbackground(0);textcolor(7);
int n42=90;

c++;

switch(c)

{ case 1: clrscr();

write_student();break;

case 2: display_alls();break;

case 3:

char num[6];

clrscr();

textbackground(0);

textmode(C80);

clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);


gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

textcolor(10);

gotoxy(25,6);cprintf("Please Enter The Admission No. ");

cin>>num;gotoxy(55,6);cout<<num;
gotoxy(12,19);textcolor(13);cprintf("*************************************************
**************");

gotoxy(30,21);textcolor(14+BLINK);cprintf("Press any key to return...");

display_sps(num);

break;

case 4:

textbackground(0);

textmode(C80);

clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for ( g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);


gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

modify_student();break;

case 5: delete_student();break;

case 6: clrscr();

write_book();break;

case 7: display_allb();break;

case 8: {
char num[6];

//clrscr();

textbackground(0);

textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");
gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

textcolor(11);

gotoxy(15,5);cprintf("***************************************************");

gotoxy(15,7);cprintf("***************************************************");

textcolor(10);

gotoxy(25,6);cprintf("...Displaying specific book ...");

gotoxy(30,10);textcolor(12);cprintf("Please Enter The book No. ");

cin>>num;gotoxy(55,10);cout<<num;

n42=0;

display_spb(num,n42);

break;
}

case 9:

textbackground(0);

textmode(C80);

//clrscr();

//int i,j,k;float a,b;char ch;

clrscr();

for ( g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");
gotoxy(79,g11);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

textcolor(11);

gotoxy(15,5);cprintf("***************************************************");

gotoxy(15,7);cprintf("***************************************************");

textcolor(10);

gotoxy(25,6);cprintf("...Modifying specific book ...");


modify_book();break;

case 10: delete_book();break;

case 11: return;

default:cout<<"\a";

getchar();

// cout<<"\n\n\n\tADMINISTRATOR MENU";

// cout<<"\n\n\t

// cout<<"\n\n\t

// Ucout<<"\n\n\t
// cout<<"\n\n\t

//P cout<<"\n\n\t

// cout<<"\n\n\t

// cout<<"\n\n\t

// cout<<"\n\n\t

// cout<<"\n\n\t

// cout<<"\n\n\t

// cout<<"\n\n\t

// cout<<"\n\n\tPlease Enter Your Choice (1-

//***************************************************************

// THE MAIN FUNCTION OF PROGRAM

//****************************************************************

char *s={" "};

void erase()

{for(int pp=5;pp<=19;pp++)

{textbackground(0);

gotoxy(40,pp);cout<<s;

char item[4][30]={ {"1. Issue Book"},

{"2. Deposit Book"},

{"3. Administrator Menu"},


{"4. Exit the Program"},

};

int main()

int dr=9,gm=2;

initgraph( &dr,&gm,"C:\\TURBOC3\\BGI\\" );

//delay (2000);

int d,a2,b4,x,z,i3,r7;

char a1[90],m[80],s[80],g[80],g1[10],g2[20],g3[20];

int x11,y11=0,x22,y22,x33,y33,j6;

r7=0;

x11=getmaxx()/2;

j6=0;i3=0;

setbkcolor(9);

while(r7<=295)

i3++;

if (y11<=490)y11=y11+5;

else

cleardevice();

y11=0;
}

for (j6;j6<=(i3*4);j6++)

setcolor(15);

settextstyle(7,1,4);

char sp[90],dp[90];

sprintf(sp,"LOADING. . . .");

sprintf(dp,"Verifying Database Files. . .");

outtextxy(50,80,sp);

outtextxy(80,20,dp);

setcolor(14);

x22=100*sin(j6*3.14/180)+x11;

y22=30*cos(j6*3.14/180)+y11;

x33=(2*x11)-x22;

y33=(2*y11)-y22;

line(x22,y22,x33,y33);

line(x22,y22-3,x33,y33-3);

setcolor(2);

circle(x22,y22,8);

circle(x33,y33,8);

setcolor(5);

circle(x22,y22,5);

circle(x33,y33,5);

setcolor(1);

circle(x22,y22,3);
circle(x33,y33,3);

setcolor(0);

line(x22,y22,x33,y33);

r7=r7+1;

setbkcolor(0);

setcolor(13);

circle (320,250,800);

setfillstyle (8,13);

floodfill (320,250,13);

for (i3=0; i3<400 ; i3=i3+3)

delay(10);

setbkcolor(14);

setcolor(14);

circle (320,250,i3);

setfillstyle (8,14);

for(int h=1 ; h<3 ; h=h+1)

for (int p=1; p<10 ; p=p+1)


{

settextstyle(p,0,5);

sprintf (m,"Christ Church Boys` Senior",2);

setcolor(1);

outtextxy(120,15,m);

delay(110);

settextstyle(p,0,5);

sprintf (m,"Christ Church Boys` Senior",2);

setcolor(0);

outtextxy(120,15,m);

settextstyle(4,0,5);

sprintf (m,"Christ Church Boys` Senior",2);

setcolor(1);

outtextxy(120,15,m);

for(int o=1 ; o<3 ; o=o+1)

for (int l=1; l<10 ; l=l+1)

settextstyle(l,0,5);

sprintf (s,"Secondary School",2);

setcolor(1);

outtextxy(255,65,s);

delay(110);
setcolor(0);

settextstyle(l,0,5);

sprintf (s,"Secondary School",2);

outtextxy(255,65,s);

settextstyle(4,0,5);

sprintf (s,"Secondary School",2);

setcolor(1);

outtextxy(255,65,s);

int s23=0;

for (int t=2 ; t<500 ; t=t+1)

setcolor(2);

rectangle (0,0,95,t);

setfillstyle (4,12);

floodfill (0,0,2);

delay(5);

z=25;

a2=130;

int b5;

b5=250;

x=355;
for(int q=16; q>1 ; q=q-1)

settextstyle(7,0, 9) ;

setcolor(0);

sprintf(g,"2",2);

outtextxy( z,q,g);

a2=a2-1;

settextstyle(7,0, 9) ;

setcolor(0);

sprintf(g1,"0",2);

outtextxy( z,a2,g1);

b5=b5-1;

settextstyle(7,0, 9) ;

setcolor(0);

sprintf(g2,"1",2);

outtextxy( z,b5,g2);

x=x-1;

settextstyle(7,0, 9) ;

setcolor(0);

sprintf(g3,"7",2);

outtextxy( z,x,g3);

delay(50);

setcolor(1);

sprintf(g,"2",2);

outtextxy( z,q,g);
settextstyle(7,0, 9) ;

setcolor(1);

sprintf(g1,"0",2);

outtextxy( z,a2,g1);

settextstyle(7,0, 9) ;

setcolor(1);

sprintf(g2,"1",2);

outtextxy( z,b5,g2);

settextstyle(7,0, 9) ;

setcolor(1);

sprintf(g3,"7",2);

outtextxy( z,x,g3);

settextstyle(7,0,9) ;

setcolor(0);

sprintf(g,"2",2);

outtextxy(z,1,g);

settextstyle(7,0,9) ;

setcolor(0);

sprintf(g1,"0",2);

outtextxy(z,114,g1);

settextstyle(7,0,9) ;

setcolor(0);

sprintf(g2,"1",2);

outtextxy(z,234,g2);
settextstyle(7,0, 9) ;

setcolor(0);

sprintf(g3,"7",2);

outtextxy(z,339,g3);

for (int u=0; u<460 ; u=u+24 )

setcolor(13);

settextstyle(4,0,2);

sprintf(a1,"",2);

setcolor(11);

outtextxy(1,u,a1);

setcolor(13);

outtextxy(97,u,a1);

outtextxy(622,u,a1);

char k1[90];

char k2[90];

char k3[90];

char k4[90];

char k5[90];

char k6[90];

char k7[90];

char k8[90];

float x1,y1;

for (int q1=90 ; q1>0 ; q1=q1-.01)


{

x1=25*sin(q1*3.14/180)+220;

y1=200*cos(q1*3.14/180)+250;

setcolor(6);

circle(x1,y1,2);

setfillstyle(1,6);

floodfill(x1,y1,6);

float x8,y8;

for (int q8=270 ; q8<360 ; q8=q8+1)

x8=25*sin(q8*3.14/180)+290;

y8=200*cos(q8*3.14/180)+250;

setcolor(6);

circle(x8,y8,2);

setfillstyle(1,6);

floodfill(x8,y8,6);

float x3,y3;

for (int q3=90 ; q3>0 ; q3=q3-.01)

x3=25*sin(q3*3.14/180)+460;

y3=200*cos(q3*3.14/180)+250;

setcolor(6);

circle(x3,y3,2);
setfillstyle(1,6);

floodfill(x3,y3,6);

float x4,y4;

for (int q4=270 ; q4<360 ; q4=q4+1)

x4=25*sin(q4*3.14/180)+530;

y4=200*cos(q4*3.14/180)+250;

setcolor(6);

circle(x4,y4,2);

setfillstyle(1,6);

floodfill(x4,y4,6);

for (int x5=240 ; x5<270 ; x5=x5+1)

setcolor(6);

circle(x5,250,2);

setfillstyle(1,6);

floodfill(x5,250,6);

for (x5=490 ; x5<507 ; x5=x5+1)

setcolor(6);

circle(x5,250,2);

setfillstyle(1,6);
floodfill(x5,250,6);

for (x5=220 ; x5<285 ; x5=x5+1)

setcolor(6);

circle(x5,450,2);

setfillstyle(1,6);

floodfill(x5,450,6);

for (x5=460 ; x5<525 ; x5=x5+1)

setcolor(6);

circle(x5,450,2);

setfillstyle(1,6);

floodfill(x5,450,6);

floodfill(500,420,6);

floodfill(250,420,6);

setcolor(2);

rectangle (200,150,540,230);

setfillstyle(1,2);

floodfill(230,170,2);

for (x5=200 ; x5<540 ; x5=x5+30)

setcolor(10);
circle(x5,151,20);

setfillstyle(1,10);

floodfill(x5,151,10);

for (x5=190 ; x5<580 ; x5=x5+30)

setcolor(10);

circle(x5,171,20);

setfillstyle(1,10);

floodfill(x5,171,10);

for (x5=190 ; x5<580 ; x5=x5+30)

setcolor(10);

circle(x5,201,20);

setfillstyle(1,10);

floodfill(x5,201,10);

for (x5=190 ; x5<580 ; x5=x5+30)

setcolor(10);

circle(x5,221,20);

setfillstyle(1,10);

floodfill(x5,230,10);

}
for (x5=200 ; x5<540 ; x5=x5+30)

setcolor(10);

circle(x5,231,20);

setfillstyle(1,10);

floodfill(x5,241,10);

setcolor(12);

circle (200,200,9);

setfillstyle(1,12);

floodfill(200,200,12);

setcolor(12);

circle (230,230,9);

setfillstyle(1,12);

floodfill(230,230,12);

setcolor(12);

circle (290,170,9);

setfillstyle(1,12);

floodfill(290,170,12);

setcolor(12);

circle (300,210,9);

setfillstyle(1,12);

floodfill(300,210,12);

setcolor(12);

circle (340,240,9);
setfillstyle(1,12);

floodfill(340,240,12);

setcolor(12);

circle (330,215,9);

setfillstyle(1,12);

floodfill(330,215,12);

setcolor(12);

circle (390,170,9);

setfillstyle(1,12);

floodfill(390,170,12);

setcolor(12);

circle (370,180,9);

setfillstyle(1,12);

floodfill(370,180,12);

setcolor(12);

circle (410,215,9);

setfillstyle(1,12);

floodfill(410,215,12);

setcolor(12);

circle (410,190,9);

setfillstyle(1,12);

floodfill(410,190,12);

setcolor(12);

circle (430,200,9);

setfillstyle(1,12);
floodfill(430,200,12);

setcolor(12);

circle (470,200,9);

setfillstyle(1,12);

floodfill(470,200,12);

setcolor(12);

circle (500,165,9);

setfillstyle(1,12);

floodfill(500,165,12);

setcolor(12);

circle (530,215,9);

setfillstyle(1,12);

floodfill(530,215,12);

setcolor(12);

circle (500,215,9);

setfillstyle(1,12);

floodfill(500,215,12);

setcolor(15);

rectangle (230,290,520,310);

setfillstyle(1,15);

floodfill(250,300,15);

setcolor(1);

rectangle (230,290,520,310);

setcolor(15);

rectangle (230,350,520,370);
setfillstyle(1,15);

floodfill(250,360,15);

setcolor(1);

rectangle (230,350,520,370);

char w1[90],w2[90];

settextstyle(2,0,4);

sprintf(w1,"A R B O R S C I E N T A E",2);

outtextxy(300,292,w1);

settextstyle(2,0,4);

sprintf(w2,"A R B O R V I T A E",2);

outtextxy(320,352,w2);

getch();

for(int i9=0 ; i9<=700 ; i9++)

rectangle(0,0,i9,550);

//floodfill(320,250,1);

for (int r2=0;r2<400;r2=r2+1)

setcolor(15);

circle(320,250,r2);

delay(5);

setcolor(1);
settextstyle(4,0,5);

outtextxy(220,40,"PREFACE");

settextstyle(1,0,3);

outtextxy(35,200,"This project is based on C++ language. It displays");

outtextxy(35,240,"the library management system of a school ");

//outtextxy(35,280,"in JEE-MAIN 2016 conducted by the Central Board.");

//outtextxy(35,320,"of Secondary Education. ");

getch();

//closegraph();

//clrscr();

//initgraph (&dr , &gm ,"C:\\TURBOC3\\BGI");

for(i9=700 ; i9>0 ; i9--)

rectangle(0,0,i9,550);

for (r2=400;r2>0;r2=r2-1)

setcolor(15);

circle(320,250,r2);

delay(5);

setcolor(1);

settextstyle(4,0,5);

outtextxy(90,40,"ACKNOWLEDGEMENT");
settextstyle(1,0,3);

outtextxy(35,150,"We would like to thank our computer sci. teacher");

outtextxy(35,190,"MR.A Y MAJUMDAR for giving us this project and");

outtextxy(35,230,"also taught us C++ language We would also ");

outtextxy(35,270,"thank our friends Harsh and Sameer who provided us with the");

outtextxy(35,310,"provided us with the additional help.");

getch();

/*

setcolor(15);

for( i9=550 ; i9>0 ; i9--)

delay(1);

rectangle(0,0,700,i9);
}

//char k2[99];

for(i9=400 ; i9>0 ;i9=i9-1)

setcolor(13);

circle(320,250,i9);

delay(1);

for ( i9=0 ;i9<650;i9=i9+11)

setcolor(14);

sprintf(k2,"",2);

settextstyle(4,0,3);

outtextxy(i9,1,k2);

setcolor(14);

sprintf(k2,"",2);

settextstyle(4,0,3);

outtextxy(i9,440,k2);

// char k8[99];

setcolor(4);

sprintf(k8,"Program on Library-Management",5);
settextstyle(4,0,4);

outtextxy(120,50,k8);

int rh=185 ;

char k9[99];

//settextstyle(4,0,3);

setcolor(1);

for(i9=0;i9<=3;i9++)

//sprintf(k8,"",4);

//outtextxy(150,rh,k8);

settextstyle(5,0,3);

strcpy(k9,item[i9]);

outtextxy(200,rh,k9);

rh=rh+40;

//getch();
*/

top:

textbackground(0);

textmode(C80);

clrscr();

int i,j,k;float a,b;char ch;

clrscr();

for (int g11=0;g11<=80;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(g11,1);cprintf("");

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(g11,24);cprintf("");

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(14);else textcolor(13);

gotoxy(1,g11);cprintf("");

gotoxy(79,g11);cprintf("");
}

for (g11=2;g11<=23;g11++)

if (g11%2==0) textcolor(13);else textcolor(14);

gotoxy(2,g11);cprintf("");

gotoxy(80,g11);cprintf("");

gotoxy(23,5);

textcolor(10);

int hj=20;

for (j=4;j<=21;j++)

textcolor(10);

gotoxy(21,j);

cprintf("****************************************");

// int h,u;

for (i=21;i>=5;i--)
{

u=i;

gotoxy(23,i);

h=(-1)*(i-22);

for(int l=1;l<=h;l++)

for(int g=1;g<=l;g++)

textcolor(0);

cprintf("**");

u++;

gotoxy(23,u);

delay(50);
}

for (t=21;t>=5;t--)

b=57;

for (j=t;j>=5;j--)

textcolor(0);

gotoxy(b,j);

cprintf("**");

b=b-2;

delay(50);

textcolor(14);gotoxy(17,5);

cprintf("*********** CHRIST CHURCH BOYS` SENIOR ************");

gotoxy(20,6);

cprintf("************ SECONDARY SCHOOL ***************");


textcolor(10);gotoxy(23,7);

cprintf("************************************");

textcolor(12);

gotoxy(28,9);cprintf("Library Management Project");

textcolor(5);gotoxy(37,10);cprintf("2016-17");

textcolor(15);

int r=12 ;

int jk=r;

for(i=0;i<=3;i++)

{ gotoxy(30,r);cprintf(item[i]);r=r+2;

r=12;

gotoxy(30,jk);

textbackground(4);

cprintf (item[0]);

int c;

do

{if(r==11) {c=0;}

else {c=(r/2)-6;}

ch=getch();

switch(ch)

{ case 72:if(r<=jk)

{ gotoxy(30,jk);
textbackground(0);

cprintf (item [0]);

r=jk+6;gotoxy(30,r);

textbackground(4);

cprintf(item[3]);

else

{ gotoxy(30,r);

textbackground(0);

cprintf(item[c]);

r=r-2;c=c-1;gotoxy(30,r);

textbackground(4);

cprintf(item[c]);

} break;

case 80:if(r>=jk+6)

{ gotoxy(30,jk+6);

textbackground(0);

cprintf(item[3]);

r=jk;gotoxy(30,r);

textbackground(4);

cprintf(item[0]);

else

{ gotoxy(30,r);
textbackground(0);

cprintf(item[c]);

r=r+2;c=c+1;gotoxy(30,r);

textbackground(4);

cprintf(item[c]);

break;

while(ch !=13);

textbackground(0);textcolor(7);

c++;

//intro();

switch(c)

{ case 1:clrscr();

book_issue();

goto top;

break;

case 2:book_deposit();

goto top;

break;

case 3:admin_menu();

goto top;
break;

case 4 :intro();exit(0);

default :cout<<"\a";

getchar();

return 0;

//***************************************************************

// END OF PROJECT

Você também pode gostar