Computer Science Project Final

Embed Size (px)

Citation preview

  • 8/3/2019 Computer Science Project Final

    1/42

    42

    LIBRARY MANAGEMENTSYSTEM

    Version 1.0 (2009-2010)

    Computer Science Project

    Developed By

    Kapil AgarwalIshan ChawlaNeeraj Kumar

    Delhi Public School, R.K.Puram, New Delhi

  • 8/3/2019 Computer Science Project Final

    2/42

    42

    Index

    Sno Description PageNo1 Certificate 32 Introduction 43 Source Code 54 Output Screen 245 Acknowledgements 406 Merits & Limitations 417 Hardware-Software Requirement 42

  • 8/3/2019 Computer Science Project Final

    3/42

    42

    Certificate

    This is to certify that Library ManagementSystem computer project is developed byKapil Agarwal, Ishan Chawla and NeerajKumar under my supervision in the computer labof Delhi Public School, R.K.Puram in thesession 2009-2010. The work done by them isoriginal.

    Mrs. Hema JainComputer Science Teacher

    Date: ___________

  • 8/3/2019 Computer Science Project Final

    4/42

    42

    Introduction

    The project highlights the functioning of a LibraryManagement System.

    Our original ideas include developing a menu basedsystem to enhance the quality of our project. Itstores related data like member details, bookdetails. It is meant to be operated by the person at

    the reception/librarian. The program can be used toeffectively manage the various books present in alibrary so that information about them can be easilyobtained. The user can easily enter informationabout an entire library of books and retrieve it athis/her own convenience using the various search

    operations included in the program. The user canalso add names and other important informationabout the members of the library which can also beretrieved whenever required. There is also anotherfeature where the user can later add or delete theexisting record of books or members. The user canalso, using the program, find out which books have

    been issued and to whom.

    The project has been created with utmost intricacyand it is hoped that it would prove to be useful in thelong run.

  • 8/3/2019 Computer Science Project Final

    5/42

    42

    Source C++ Code/*

    Program name :

    Version :

    Filename : Developers :

    School Name :

    */

    #include

    #include

    #include

    #include

    #include

    #include

    const char TL=218,TR=191,BL=192,BR=217,HL=196,VL=179;

    void DispCh(int C,int R,char Ch);

    void AboutUs();

    void ModifyTitle();void ModifyAuthor();

    void ModifyPrice();

    void ModifyName();

    void ModifyAdd();

    void ModifyEmail();

    void ModifyMob();

    void DispCh(int C,int R,char Ch[]);

    void Color(int TC,int TB);

    void Recta(int C1,int R1,int C2,int R2);

    int VMenu(int C,int R,char Men[][15],int Noo);

    int HMenu(int C,int R,char Men[][15],int Noo);

    void ShowB();

    void ShowM();

    void InsertB();

    void InsertM();

    void SearchBno();

    int LastBno();

    int LastMno();

    void SearchTitle();

    void SearchAuthor();

    void SearchMno();

    void SearchMob();

    void SearchEmail();

    void SearchName();

    void DeleteB();

    void DeleteM();

    void Issue();void Return();

    void EditMBno(int imno,int ibno);

    void EditBMno(int imno,int ibno);

    void NIssueB();

    void NIssueM();

    void IssueB();

    void IssueM();

  • 8/3/2019 Computer Science Project Final

    6/42

    42

    //MAIN CLASS

    class Book

    {

    int Bno;

    char Title[50];

    char Author[50];

    int Price;

    int Mno;

    public:

    Book() { Mno=0; }

    void AddB(int );

    void DisplayB();

    int RBno() { return Bno; }

    int RBMno() { return Mno; }

    char* RTitle() { return Title; }

    char* RAuthor() { return Author; }

    void EditTitle() { cout

  • 8/3/2019 Computer Science Project Final

    7/42

    42

  • 8/3/2019 Computer Science Project Final

    8/42

    42

    char S4Menu[][15]={"Books ",

    "Members ",

    "About Us",

    "Quit "};

    char S41Menu[][15]={"Issued ",

    "Non Issued",

    "Quit "};

    char Menu[][15]={"Book ",

    "Member ",

    "Utility",

    "Reports",

    "Quit "};

    AboutUs();getch();

    int Quit=0,N,SN,SN1;

    do

    {

    clrscr();

    //Display Main Menu1

    N=HMenu(1,1,Menu,5),SN;

    switch (N)

    {case 0:SN=VMenu(1,2,S1Menu,6);

    switch(SN)

    {

    case 0:clrscr();InsertB();break;

    case 1:clrscr();ShowB();break;

    case 2:SN1=VMenu(9,4,S13Menu,4);

    switch(SN1)

    {

    case 0:clrscr();SearchBno();break;

    case 1:clrscr();SearchTitle();break;

    case 2:clrscr();SearchAuthor();break;

    }

    break;

    case 3:clrscr();DeleteB();break;

    case 4:SN1=VMenu(9,6,S15Menu,4);

    switch(SN1)

    {

    case 0:clrscr();ModifyTitle();break;

    case 1:clrscr();ModifyAuthor();break;

    case 2:clrscr();ModifyPrice();break;

    }

    }

    getch();

    break;

    case 1:SN=VMenu(11,2,S2Menu,6);

    switch(SN)

    {case 0:clrscr();InsertM();break;

    case 1:clrscr();ShowM();break;

    case 2:SN1=VMenu(19,4,S23Menu,5);

    switch(SN1)

    {

    case 0:clrscr();SearchMno();break;

    case 1:clrscr();SearchName();break;

    case 2:clrscr();SearchMob();break;

    case 3:clrscr();SearchEmail();break;

  • 8/3/2019 Computer Science Project Final

    9/42

    42

    }

    break;

    case 3:clrscr();DeleteM();break;

    case 4:SN1=VMenu(19,6,S25Menu,5);

    switch(SN1)

    {

    case 0:clrscr();ModifyName();break;

    case 1:clrscr();ModifyAdd();break;

    case 2:clrscr();ModifyMob();break;

    case 3:clrscr();ModifyEmail();break;

    }

    break;

    }

    getch();

    break;

    case 2:SN=VMenu(21,2,S3Menu,3);

    switch(SN)

    {

    case 0:clrscr();Issue();break;

    case 1:clrscr();Return();break;

    }getch();

    break;

    case 3:SN=VMenu(31,2,S4Menu,4);

    switch(SN)

    {

    case 0:SN1=VMenu(40,2,S41Menu,3);

    switch(SN1)

    {

    case 0:clrscr();IssueB();break;

    case 1:clrscr();NIssueB();break;

    }

    break;

    case 1:SN1=VMenu(40,3,S41Menu,3);

    switch(SN1)

    {

    case 0:clrscr();IssueM();break;

    case 1:clrscr();NIssueM();break;

    }

    break;

    case 2:AboutUs();break;

    }

    getch();

    break;

    case 4:clrscr();

    AboutUs();

    Quit=1;

    break;}

    }

    while (!Quit);

    getch();

    }

  • 8/3/2019 Computer Science Project Final

    10/42

    42

    //GENRAL FUNCTIONS

    void DispCh(int C,int R,char Ch)

    {

    gotoxy(C,R);cprintf("%c",Ch);//C 1-80 R 1-25

    }

    void DispCh(int C,int R,char Ch[])

    {

    gotoxy(C,R);cprintf("%s",Ch);

    }

    void Color(int TC,int TB)

    {

    textcolor(TC);

    textbackground(TB);

    }

    void Recta(int C1,int R1,int C2,int R2)

    {

    DispCh(C1,R1,TL);

    DispCh(C2,R1,TR);

    DispCh(C1,R2,BL);

    DispCh(C2,R2,BR);

    for (int i=C1+1;i Checking if already on top

    Sel=Noo-1; // Move to the last option

    else //

    Sel--; // Move one option up

    break;

    case 80:if (Sel==Noo-1) //Down -> Checking if already at bottom

  • 8/3/2019 Computer Science Project Final

    11/42

    42

    Sel=0; // Move to the first option

    else //

    Sel++; // Move one step down

    break;

    case 27:Sel=-1; //Escape-> Getting out of the Menu without valid

    selection

    case 13:Exit=1; //Enter-> Getting out of the Menu with current

    selection

    }

    DispCh(C+1,R+Tsel+1,Men[Tsel]);//Redisplaying the non-highlighted option

    }

    while (!Exit);

    return Sel; //Returning the selected value from menu

    }

    int HMenu(int C,int R,char Men[][15],int Noo)

    {

    int Exit=0,Sel=0;

    Color(YELLOW,BLUE);

    for (int i=0;i

  • 8/3/2019 Computer Science Project Final

    12/42

    42

    fil.close();

    }

    void ShowB()

    {

    fstream fil;

    fil.open("Book.dat",ios::binary|ios::in);

    Book S;

    cout

  • 8/3/2019 Computer Science Project Final

    13/42

    42

    }

    }

    if (found==0)

    cout

  • 8/3/2019 Computer Science Project Final

    14/42

    42

    void SearchAuthor()

    {

    char sauthor[50];

    int found=0;

    fstream fil;

    fil.open("Book.dat",ios::binary|ios::in);

    Book S;

    cout

  • 8/3/2019 Computer Science Project Final

    15/42

    42

    coutsmno;

    while(fil1.read((char*)&S,sizeof(S)))

    {

    if(S.RMno()!=smno)

    fil2.write((char*)&S,sizeof(S));

    else

    del++;

    }

    if(!del)

    cout

  • 8/3/2019 Computer Science Project Final

    16/42

    42

    cout

  • 8/3/2019 Computer Science Project Final

    17/42

    42

    coutsmob;

    while (fil.read((char*)&S,sizeof(S)) && (!found))

    {

    if(strcmpi(S.RMob(),smob)==0)

    {

    cout

  • 8/3/2019 Computer Science Project Final

    18/42

    42

    S.EditName();

    int N=fil.tellg()-sizeof(S);

    fil.seekp(N);

    fil.write((char*)&S,sizeof(S));

    }

    else

    cout

  • 8/3/2019 Computer Science Project Final

    19/42

    42

    coutSMno;

    while(!found && fil.read((char*)&S,sizeof(S)))

    if (S.RMno()==SMno)

    found++;

    if (found)

    {

    S.EditEmail();

    int N=fil.tellg()-sizeof(S);

    fil.seekp(N);

    fil.write((char*)&S,sizeof(S));

    }

    else

    cout

  • 8/3/2019 Computer Science Project Final

    20/42

    42

    else cout

  • 8/3/2019 Computer Science Project Final

    21/42

    42

    }

    }

    }

    else cout

  • 8/3/2019 Computer Science Project Final

    22/42

    42

    cout

  • 8/3/2019 Computer Science Project Final

    23/42

    42

    M.DisplayB();

    }

    fil.close();

    }

    int LastMno()

    {

    fstream fil;

    fil.open("Member.dat",ios::binary|ios::in);

    Member M;

    int LMno=100;

    while(fil.read((char*)&M,sizeof(M)))

    {

    LMno=M.RMno();

    }

    fil.close();

    return LMno;

    }

    int LastBno()

    {

    fstream fil;

    fil.open("Book.dat",ios::binary|ios::in);Book B;

    int LBno=100;

    while(fil.read((char*)&B,sizeof(B)))

    {

    LBno=B.RBno();

    }

    fil.close();

    return LBno;

    }

    void AboutUs()

    {

    clrscr();

    gotoxy(27,7);

    cout

  • 8/3/2019 Computer Science Project Final

    24/42

    42

    Output Screens

  • 8/3/2019 Computer Science Project Final

    25/42

    42

  • 8/3/2019 Computer Science Project Final

    26/42

    42

  • 8/3/2019 Computer Science Project Final

    27/42

    42

  • 8/3/2019 Computer Science Project Final

    28/42

    42

  • 8/3/2019 Computer Science Project Final

    29/42

    42

  • 8/3/2019 Computer Science Project Final

    30/42

    42

  • 8/3/2019 Computer Science Project Final

    31/42

    42

  • 8/3/2019 Computer Science Project Final

    32/42

    42

  • 8/3/2019 Computer Science Project Final

    33/42

    42

  • 8/3/2019 Computer Science Project Final

    34/42

    42

  • 8/3/2019 Computer Science Project Final

    35/42

    42

  • 8/3/2019 Computer Science Project Final

    36/42

    42

  • 8/3/2019 Computer Science Project Final

    37/42

    42

  • 8/3/2019 Computer Science Project Final

    38/42

    42

  • 8/3/2019 Computer Science Project Final

    39/42

    42

  • 8/3/2019 Computer Science Project Final

    40/42

    42

    Acknowledgements

    We would like to thank our computer scienceteachers Mrs. Hema Jain and Mr. MukeshKumar who gave their valuable opinions andsuggestions and have been instrumental in allowingthis project to be completed. Also, we would like tothank the lab assistant who helped us whenever we

    faced difficulties. Finally, we wish to thank ourparents for their love and encouragement, without

    whom we would never have enjoyed so manyopportunities.

  • 8/3/2019 Computer Science Project Final

    41/42

    42

    Merits & Limitations

    The project has a verybasic functional design which can easily accommodate smaller databases.The entered records of books and members can bedisplayed in a tabular manner, which enables theuser to see all the available details. The formattinghas to be precise and lengthy elaborations may

    disrupt the tabular display.

    Some features, however, enable the project to beextremelyuser friendly. Any book can be searchedfor among the many records at ones ownconvenience. Book names, member details and other

    details can be edited using the Modify feature. Wecan also check which book has been issued. Onlythose books will be issued which have not beenalready issued. This makes our project morecomprehensive.

  • 8/3/2019 Computer Science Project Final

    42/42

    Hardware & Software

    Requirement

    Hardware RequirementPentium 3/4/Core 2 Duo/Dual coreWith at least 256 MB RAM

    2 MB free space on Hard DiskColor Monitor/LCD

    Operating SystemMS Windows 98/XP/VistaTurbo C++ 3.0 Compiler