c++

c++

c++

Sunday, 21 September 2014

Library

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

//                   HEADER FILE USED IN PROJECT

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

 

#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<string.h>
#include<iomanip.h>
 

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

//                   CLASS USED IN PROJECT

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

 

 

 

class book

{

char bno[6];

char bname[50];

char aname[20];

public:

void create_book()

{

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

cout<<"\nEnter The book no.";

cin>>bno;

cout<<"\n\nEnter The Name of The Book ";

gets(bname);

cout<<"\n\nEnter The Author's Name ";

gets(aname);

cout<<"\n\n\nBook Created..";

}

 

void show_book()

{

cout<<"\nBook no. : "<<bno;

cout<<"\nBook Name : ";

puts(bname);

cout<<"Author Name : ";

puts(aname);

}

 

void modify_book()

{

cout<<"\nBook no. : "<<bno;

cout<<"\nModify Book Name : ";

gets(bname);

cout<<"\nModify Author's Name of Book : ";

gets(aname);

}

 

char* retbno()

{

return bno;

}

 

void report()

{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();

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

cout<<"\nEnter The admission no. ";

cin>>admno;

cout<<"\n\nEnter The Name of The Student ";

gets(name);

token=0;

stbno[0]='/0';

cout<<"\n\nStudent Record Created..";

}

 

void show_student()

{

cout<<"\nAdmission no. : "<<admno;

cout<<"\nStudent Name : ";

puts(name);

cout<<"\nNo of Book issued : "<<token;

if(token==1)

cout<<"\nBook No "<<stbno;

}

 

void modify_student()

{

cout<<"\nAdmission no. : "<<admno;

cout<<"\nModify Student Name : ";

gets(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()

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

 

};