Hostel Mgt

download Hostel Mgt

of 21

Transcript of Hostel Mgt

  • 8/8/2019 Hostel Mgt

    1/21

    OF

    Hostel Management System

    Submitted in the partial fulfillment of the Degree of Bachelor of

    Technology (Integrated)

    In

    Computer Science and Engineering

    SUBMITTED BY:- GUIDED BY: Name Pankaj Negi Miss Sukhdilpreet Kaur

    Regd.No 10804097

    Rollno R246A10

    SUBMITTED TODepartment of Computer Science and Engineering Lovely Professional

    University Phagwara

  • 8/8/2019 Hostel Mgt

    2/21

    ACKNOWLEDGEMENT

    I take this opportunity to present my votes of thanks to all those guidepost

    who really acted as lightening pillars to enlighten our way throughout this

    project that has led to successful and satisfactory completion of this study.

    We are really grateful to our HOD Mr. Rohit Dhand for providing us withan opportunity to undertake this project in this university and providing us

    with all the facilities. We are highly thankful to Miss Sukhdilpreet Kaur for

    her active support, valuable time and advice, whole-hearted guidance,

    sincere cooperation and pains-taking involvement during the study and in

    completing the assignment of preparing the said project within the time

    stipulated.

    Lastly, We are thankful to all those, particularly the various friends , who

    have been instrumental in creating proper, healthy and conductive

    environment and including new and fresh innovative ideas for us during

    the project, their help, it would have been extremely difficult for us toprepare the project in a time bound framework.

    Name Pankaj Negi

    Reg.No 10804097

    Rollno. R246A10

  • 8/8/2019 Hostel Mgt

    3/21

    TABLE OF

    CONTENTS

    Introduction

    Proposed system

    Description

    System requirements

    Requirement Analysis

    System Design

    Source code

    Testing

    Future scope of project

  • 8/8/2019 Hostel Mgt

    4/21

    INTRODUCTION

    In the existing system, most of the records are maintained on paper.

    It becomes very inconvenient to modify the data. In the existing

    system, here is a possibility that the same data in different registers

    may have different values which means the entries of the same data

    do not match. This inconsistent state does not supply the concrete

    information which poses a problem in the case information related

    to particular search record.

    Our project is very useful. User is no longer required to check his

    register in search of records, as now it can be searched over the

    software by choosing some options. The user need not to type in

    most of the information. He/she is just required to enter the desired

    options. On the whole it liberates the user from keeping lengthy

    manual records. In a nutshell, it abates the work load of anorganization.

    In todays world, no one likes to perform calculations on calculator

    or manually when computer is there. Every one wants his/her work

    to be done by computer automatically and displaying the result for

    further manipulations.

  • 8/8/2019 Hostel Mgt

    5/21

    PROPOSED SYSTEM

    The following documentation is a project the Hostel ManagementSystem .

    It is a detailed summary of all the drawbacks of the old system and how the

    new proposed system overcomes these shortcomings. The new system takes

    into account the various factors while designing a new system. It keeps into

    the account the Economical bandwidth available for the new system. Theforemost thing that is taken care of is the Need and Requirements of the User.

    DESCRIPTION

    Before developing software we keep following things in mind that we can

    develop powerful and quality software

    PROBLEM STATEMENTo Problem statement was to design a module:

    o

    Which is user friendlyo Which will restrict the user from accessing other users data.

    o Which will help user in viewing his data and privileges.

    o Which will help the administrator to handle all the changes.

    FUNCTIONS TO BE PROVIDED:The system will be user friendly and completely menu driven so that the users

    shall have no problem in using all options.

    o The system will be efficient and fast in response.

    o The system will be customized according to needs.

    o

    Addo Display

    o Modify

    o Delete

    SYSTEM REQUIRMENTS

    Operating system: MS Windows XP or Windows Vista

    Language: C LanguageProcessor: Pentium IV Processor

    RAM: 512 MB

    Hard disk: 5 GB

  • 8/8/2019 Hostel Mgt

    6/21

    REQUIREMENT ANALYSIS

    This process is adopted when management of the system development,

    Personnel decide that the particular system needs improvement. The system

    development life cycle is the set of activities, carried out by the analyst,

    designers and users to develop and implement a system. The systems that are

    present in the nature follow common life cycle pattern. For example considerthe raining system. Initially the rain falls into the river, river flows into sea,

    the sea water evaporates to form vapors, the vapors form clouds which again

    bring rain. Similarly consider a man made system initially a system is

    analyzed, designed and made operational by the efforts of system analysis.

    After successful operation or a number of users, the system becomes less and

    less effective by change in the environment. So these changes have to be

    incorporated in to the system by minor modifications. So the general activities

    from the life cycle of the system are given below:

    Select ion and identification of the system to be studied

    Preliminary study

    Defining the system

    Design and development of the system

    Implementation of the system

  • 8/8/2019 Hostel Mgt

    7/21

    SYSTEM DESIGN

    Then we began with the design phase of the system. System design is a solution, aHOW TO approach to the creation of a new system. It translates system

    requirements into ways by which they can be made operational. It is a translational

    from a user oriented document to a document oriented programmers. For that, it

    provides the understanding and procedural details necessary for the implementation.

    Here we use Flowchart to supplement the working of the new system. The system

    thus made should be reliable, durable and above all should have least possible

    Hostel Management System

    Enteryour

    choice

    eeeeee

    1. Out student 2. In student 3. Staff 4. Exit

    Enter Your

    choice

    START

    STOP

  • 8/8/2019 Hostel Mgt

    8/21

    maintenance costs. It should overcome all the drawbacks of the Old existing system

    and most important of all meet the userrequirements.

    Figure 1no

  • 8/8/2019 Hostel Mgt

    9/21

    SOURCE CODE

    /

    *************************************************************************

    **

    * File : HOSTEL.C

    * Description : Hostel management system to maintain student details as well

    as staff details..* Author : Pankaj Negi,I Year B.Tech.,LOVELY PROFESSIONAL University.

    * Version : 1.0

    * Date : 14/DEC/2008

    *************************************************************************

    ***/

    #include

    #include

    #include

    #include

    /

    ****************************************************************************

    * Function : main

    * Description :The main function is used for whole hostel management process.

    * Parameters : void

    * Returns : Void

    *************************************************************************

    ****/

    void main()

    {

    int iCh1,iInc;

    e:clrscr();

    /* To Display Main menu */

    gotoxy(26,40);

    textcolor(9);

    cprintf("INFOSYS CAMPUS CONNECT PROGRAM");

    gotoxy(32,44);

    textcolor(19);

    cprintf("LPU UNIVERSITY");

    gotoxy(16,42);

    cprintf("HOSTEL MANAGEMENT SYSTEM DONE BY PANKAJ NEGI");

    gotoxy(8,45);

    textcolor(9);

    /* To Dispaly date and time */

    cprintf("DATE : %s ",__DATE__);

    gotoxy(55,45);

    cprintf("TIME : %s ",__TIME__);

    for(iInc=0;iInc

  • 8/8/2019 Hostel Mgt

    10/21

    }

    for(iInc=0;iInc

  • 8/8/2019 Hostel Mgt

    11/21

    };

    struct hostel e;

    char icPid[4];

    int iF=0,iC=0,iF1=0;

    long int lRecsize;

    fp=fopen("hp.dat","rb+");

    if(fp==NULL)

    {

    fp=fopen("\hp.dat","wb+");

    if(fp==NULL)

    {

    puts("\n\t\tCannot Open file");

    exit();

    }

    }

    lRecsize=sizeof(e);

    while(1)

    {

    clrscr();

    textcolor(4);

    if(iCh1==1) {

    gotoxy(30,8);

    textcolor(4);

    /* Sub menu for manipulation of student and staff details */

    cprintf("OUT-student MENU"); }

    else if(iCh1==2) {

    gotoxy(30,8);

    textcolor(4);

    cprintf("IN-student MENU"); }

    else if(iCh1==3) {gotoxy(30,8);

    textcolor(4);

    cprintf("STAFF MENU"); }

    gotoxy(26,40);

    textcolor(4);

    cprintf("INFOSYS CAMPUS CONNECT PROGRAM");

    gotoxy(32,44);

    textcolor(19);

    cprintf("LPU UNIVERSITY");

    gotoxy(16,42);

    textcolor(19);cprintf("HOSTEL MANAGEMENT SYSTEM DONE BY PANKAJ NEGI");

    gotoxy(8,45);

    textcolor(4);

    cprintf("DATE : %s ",__DATE__);

    gotoxy(55,45);

    cprintf("TIME : %s ",__TIME__);

    for(iInc=0;iInc

  • 8/8/2019 Hostel Mgt

    12/21

    textcolor(7);

    cprintf("-");

    }

    for(iInc=0;iInc

  • 8/8/2019 Hostel Mgt

    13/21

    scanf("%s",e.acName);

    if(strlen(e.acName)>30||strlen(e.acName)20||strlen(e.acDesiq)1)

    goto p;

    f:

    printf("\n \t\tENTER AGE : ");

    scanf("%d",&e.iAge);

    if(iCh1==3){

    if(e.iAge65)

    goto f; }

    else

    { if(e.iAge100)

    goto f; }

    a5:

    printf("\n \t\tENTER STREET: ");

    scanf("%s",e.acStreet);

    if(strlen(e.acStreet)>30||strlen(e.acStreet)24||strlen(e.acCity)10||strlen(e.acPhno)50)

    goto a2;

    }

    if(iCh1==3) {

    printf("\n \t\tENTER DATE OF JOIN(dd-mmm-yy): ");

  • 8/8/2019 Hostel Mgt

    14/21

    scanf("%s",e.acDoj);

    v:

    printf("\n\t\tSALARY/DAY: ");

    scanf("%d",&e.iSal);

    if(e.iSal9000)

    goto v;

    }

    if(iCh1==2)

    {

    printf("\n\t\tENTER ROOM NUMBER: ");

    scanf("%s",e.acRoom);

    printf("\n \t\tENTER DATE OF JOIN: ");

    scanf("%s",e.acDoj);

    }

    fwrite(&e,lRecsize,1,fp);

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

    fflush(stdin);

    }

    break;

    case '2':

    //Searching and displaying all the information by id

    textcolor(7);

    printf("\n\n\n\t\tENTER ID: ");

    scanf("%s",icPid);

    rewind(fp);

    while(fread(&e,lRecsize,1,fp)!=0)

    {

    printf("hai");

    if(strcmp(e.acP_id,icPid)==0)

    { printf("bye");

    iC=1;clrscr();

    //Display according to Main menu

    gotoxy(0,20);

    //outpatient

    if(iCh1==1){

    printf("\n\n\n\t\tDETAILS OF OUTstudent:%s",strupr(e.acName));

    printf("\n________________________________________________________________

    _____\n\n");

    printf("\n\n NAME : %s\t ID : %s\t CONSULTANT NAME : %s\n\n SEX :

    %s\t AGE : %d \n\n STREET: %s\n\n CITY : %s\n\n PHONE : %s\n\n PATIENT

    HISTORY:%s",strupr(e.acName),strupr(e.acP_id),strupr(e.acDesiq),strupr(e.acSex),e.iAge,stru

    pr(e.acStreet),strupr(e.acCity),strupr(e.acPhno),strupr(e.acPhistory));

    printf("\n________________________________________________________________

    _____\n\n");

    getch(); }

    //Staff

    else if(iCh1==3){

    printf("\n\n\n\t\tDETAILS OF :%s %s",strupr(e.acDesiq),strupr(e.acName));

  • 8/8/2019 Hostel Mgt

    15/21

    printf("\n________________________________________________________________

    _____\n\n");

    printf("\n\n NAME : %s\t ID : %s \t DESIGNATION: %s\n\n SALARY : Rs

    %d(/day)\n\n AGE : %d \t SEX : %s \n\n DATE OF JOIN : %s\n\n STREET:

    %s\n\n CITY : %s\n\n PHONE : %s

    ",strupr(e.acName),strupr(e.acP_id),strupr(e.acDesiq),e.iSal,e.iAge,strupr(e.acSex),st

    rupr(e.acDoj),strupr(e.acStreet),strupr(e.acCity),strupr(e.acPhno),strupr(e.acPhistor

    y));

    printf("\n________________________________________________________________

    _____\n\n");

    getch(); }

    //Inpatient

    else if(iCh1==2){

    printf("\n\n\n\t\tDETAILS OF INstudent:%s",strupr(e.acName));

    printf("\n________________________________________________________________

    _____\n\n");

    printf("\n\n NAME : %s\t ID : %s\t CONSULTANT NAME : %s\n\n AGE :

    %d\t SEX : %s \t STREET: %s\n\n CITY : %s\n\n PHONE : %s\n\n PATIENT

    HISTORY: %s\n\n ROOM NUMBER : %s\n\n DATE OF ADMISSION:%s

    ",strupr(e.acName),strupr(e.acP_id),strupr(e.acDesiq),e.iAge,strupr(e.acSex),strupr(e

    .acStreet),strupr(e.acCity),strupr(e.acPhno),strupr(e.acPhistory),strupr(e.acRoom),st

    rupr(e.acDoj));

    printf("\n________________________________________________________________

    _____\n\n");

    getch(); }

    }

    }

    if(iC==0)

    {

    printf("\n\t\tRECORD DOESN'T EXISTS..");

    getch();}iC=0;

    break;

    case '3':

    //Searching and modifying Records by id

    cAns='y';

    while(cAns=='y')

    {

    printf("\n\n\n\t\tENTER ID: ");

    scanf("%s",icPid);

    rewind(fp);

    while(fread(&e,lRecsize,1,fp)==1){

    if(strcmp(e.acP_id,icPid)==0)

    {

    b:

    printf("\n\n\t\tENTER NAME: %s : ",strupr(e.acName));

    scanf("%s",e.acName);

    if(strlen(e.acName)>20||strlen(e.acName)

  • 8/8/2019 Hostel Mgt

    16/21

    printf(" \n\t\tENTER SEX : %s : ",strupr(e.acSex));

    scanf("%s",e.acSex);

    if(strlen(e.acSex)>1)

    goto b1;

    r:

    printf(" \n\t\tENTER AGE: %d : " ,e.iAge);

    scanf("%d",&e.iAge);

    if(e.iAge65)

    goto r;

    b3:

    printf(" \n\t\tENTER STREET: %s : ",strupr(e.acStreet));

    scanf("%s",e.acStreet);

    if(strlen(e.acStreet)>30||strlen(e.acStreet)24||strlen(e.acCity)10||strlen(e.acPhno)20||strlen(e.acDesiq)50)goto b5;

    }

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

    fwrite(&e,lRecsize,1,fp);

    printf("\n \t\tRECORD MODIFIED ");

    break;

    }else

    printf("\n \t\tRECORD DOESNT EXISTS ");

    }

  • 8/8/2019 Hostel Mgt

    17/21

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

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

    fflush(stdin);

    cAns=getche();

    }

    break;

    case '4':

    //Searching and deleting records by id

    cAns='y';

    while(cAns=='y')

    {

    printf("\n\n\t\tENTER ID TO DELETE RECORD : ");

    scanf("%s",icPid);

    ft=fopen("temp.dat","wb");

    rewind(fp); //Repositions file pointer to stream's beginning

    while(fread(&e,lRecsize,1,fp)!=0)

    {

    if(strcmp(e.acP_id,icPid)!=0) {

    fwrite(&e,lRecsize,1,ft);

    }

    else {

    iF1=1;

    printf("\n\n\t\t RECORD DELETED SUCCESSFULLY");

    }

    }

    if(iF1!=1){iF1=0;

    printf("\n\n\t\t NO SUCH RECORD FOUND");}

    fclose(fp);

    fclose(ft);

    remove("hp.dat");rename("temp.dat","hp.dat");

    fp=fopen("hp.dat","rb+");

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

    fflush(stdin);

    cAns=getche();

    }

    break;

    case '0':

    fclose(fp);

    goto e;

    }}

    }

    }

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

    * End of HOSTEL.c

    TESTING

  • 8/8/2019 Hostel Mgt

    18/21

    Testing is the major control measure used during software development. Its

    basic function is to detect errors in the software. During requirement analysis

    and design, the output is a document that is usually textual and no executable.

    After the coding phase, computer programs are available that can be executed

    for testing purpose. This implies that testing not only, has to uncover errors

    introduced during coding, but also errors introduced during previous phase.

    Thus the goal of testing is to uncover the requirements, design and codingerrors in the programs. So after testing the outputs of my project are as

    follows:

    Snapshots

  • 8/8/2019 Hostel Mgt

    19/21

  • 8/8/2019 Hostel Mgt

    20/21

  • 8/8/2019 Hostel Mgt

    21/21

    FUTURE SCOPE OF THE PROJECT

    Our project will be able to implement in future after making some changes

    and modifications as we make our project at a very low level. So the

    modifications that can be done in our project are: Add one more major change

    which can be done in this project is that to add the snaps of the student of

    which the record is entered. We can also add or subtract details of theindividual.