15026057 hospital management c code 123

Upload: sami-zama

Post on 03-Jun-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 15026057 Hospital Management c Code 123

    1/30

    HOSPITAL MANAGEMENT SYSTEM

    A PROJECT REPORT

    SUBMITTED ON HOSPITAL MANAGEMENT SYSTEM

    FOR A HOSPITAL IN

    GREATER NOIDA

    SUBMITTED BY:-

    Certificate

  • 8/12/2019 15026057 Hospital Management c Code 123

    2/30

    Acknowledgement

  • 8/12/2019 15026057 Hospital Management c Code 123

    3/30

    Table Of Contents

    1. Introduction

    Objective And Introduction of the Project

    2. Development Methodology

    Feasibility Study

    Requirement Analysis

    Initial Investigation

    Structured Analysis

    3. System Requirement

    Hardware Used

    Software Used

    4. System Design (PROJECT)

    Data Flow Diagrams

    Program Description in Brief

    Header Files

    System Defined Functions

    FEASIBILITY STUDY

    An important outcome of the preliminary investigation is to determine that whether the

    system requested is feasible. Depending on the results of the preliminary

  • 8/12/2019 15026057 Hospital Management c Code 123

    4/30

    investigation the survey is expended to a more detailed feasibility study.

    Feasibility study is a test of a system proposal according to its workability,

    impact on the organization, ability to meet user needs, and effective use of resources.

    The objective of feasibility study is not to solve the problem but to acquire a sense of

    its scope. During the study, the problem definition is crystallized and aspects of the

    problem to be included in the system are determined. Consequently, costs and

    benefits are estimated with greater accuracy at this stage.

    The result of the Feasibility study is a formal proposal.This is simply a report-a formal

    document detailing the nature and scope of the Proposed solution. Finally, Feasibility

    Study is carried out to select the best system that meets the performance requirements.

    A feasibility study is carried out to select the best system that meets the

    performance requirements.Feasibility is the determination of whether or not project

    is worth doing. The process followed in making this determination is called a

    Feasibility study.

    Objectives of Feasibility Study

    The main objectives of feasibility study are:

    To identify the deficiencies in the current system.

    To determine objectives of the proposed system.

    To acquire a sense of scope of the system.

    To identify the responsible users.

    To determine whether it is feasible to develop the new system.

    Steps in Feasibility Study

    Feasibility study is carried out in the following steps:

    Form a project team and appoint a project leader (Systems Analyst).

    Start preliminary investigation through different fact finding techniques.

    Prepare the systems flowcharts of the current system.

  • 8/12/2019 15026057 Hospital Management c Code 123

    5/30

    Identify and describe the deficiencies in the current system.

    Determine objectives of the proposed system.

    Prepare the systems flowchart of the proposed system.

    Identify and enumerate the existing computer systems along with their technical

    specifications. Determine the cost and benefits of the proposed system.

    Identify the responsible users and determine the operational feasibility.

    Prepare the feasibility study report.

    Give the oral presentation of the feasibility study.

    TYPES OF FEASIBILITY

    The study is conducted to evaluate the possibility of HRM systems to produce the desiredoutputs .Most successful system projects are not necessarily the biggest or most visible in a

    business but rather those that truly meet user expectations. Three key considerations

    involved are :

    1. ECONOMIC FEASIBILITY

    Economic analysis is the most frequently used method for evaluating the

    Types of Feasibility

    Technical

    Economic

    Operational

  • 8/12/2019 15026057 Hospital Management c Code 123

    6/30

    Effectiveness of a HRM Systems .Most commonly known as cost/benefit analysis, the

    procedure is to determine the benefits and savings that are expected from a system and

    compare them with costs involved.

    Benefits from The System are:

    System will be user friendly.

    No information gap.

    Accurate and latest information will help managers for quick decision

    making.

    Saving of precious time and resources.

    The cost are negligible as the needed infrastructure already exists .As the benefits greatly

    overweighs cost, the proposed system is economically feasible.

    Economic analysis is the most frequently used technique for evaluating the effectiveness

    of a proposed system. Commonly known as cost / benefit analysis. The procedure is to

    determine the benefit and savings that expected from a proposed system and compare

    them with costs.

    In case of profit, decision is taken to design and implement the system.

    The proposed system is financially feasible because of the following reason:

    1. The cost of the system development is not much because of module /

    department wise automation.

    2. Then organization wants to implement wise so this system cannot take

    a heavy amount to implement the system into the form of hardware

    investment.3. The proposed system is economic, as it will reduce the time investment

    in running the daily transaction.

    2. TECHNICAL FEASIBILITY

    Technical feasibility centers on the existing computer system

    (Hardware and software etc.) and to what extent it can support the proposed system .

  • 8/12/2019 15026057 Hospital Management c Code 123

    7/30

    In case of this system, the required infrastructure i.e. hardware, software application and

    technical know-how already exists .Thus the project is then technically feasible.

    This is concerned with specifying equipment and software that will successfully satisfy

    the user requirements. The are a number of technical issue, which are raised during the

    feasibility stage investigation. The are as follow:

    Technical feasibility centers on the existing computer system (hardware, software, etc.)

    and to what extent it can support the proposed addition. Time duration is also a part of

    technical feasibility. Time is one of the major factors to decide the success of the

    project. If project is not complete within the time duration, the budget will be

    increase definitely.

    If the budget is a serious constraint, then the project is judged not feasible .So if it is

    very serious matter, each project team should keeps in mind this, to complete the

    project with in specified time.

    The facility to produce output in a given time.

    Response time under certain condition.

    Ability to process ascertains volume of package at a particular speed.

    Facility to communicate data to distinct location.

    The proposed system is technically feasibility because of following reason:

    The organization want to build the computer based system for data.

    Maintained into the digital form so that maintaining of information will gone to

    Be easy and retrieval of the information is fast.

    After converting data into the digital form cost of stationary is saved.

    This system also able to produce the required the report in least time.

    This system has also the facility to communication among the terminals to

    distant locations.

    3. OPERATIONAL FEASIBILITY

    It is mainly related to human organizational and political aspect. the points to be

  • 8/12/2019 15026057 Hospital Management c Code 123

    8/30

    considered are:

    What changes will be brought with the system?

    What organizational structures are distributed?

    What new skills will be required?

    The proposed system is feasibility because of following reasons:

    The system reduce the workload of the staff because on a mouse click he / she the

    desired result, work can be done with the help of keyboard and mouse watching the

    computer screen not on the paper.

    The system will be build on the technology of GUI so that interaction to the system not

    be boring as like writing / preparing / maintaining data into the form of the manual

    paper. Users that work into the GUI environment works more interestingly than the

    paper based.

    This result work more efficiently.

    The proposed system is better in use and user friendly as it generates proper message

    at run time.

    The input from the user is much as the fields like supplier code. Customer code and

    current data are included itself by the system.

    4. BEHAVIOURAL FEASIBILITY

  • 8/12/2019 15026057 Hospital Management c Code 123

    9/30

    Behavioural feasibility is procedure to determine an estimate of how strong reaction the

    user staff is likely to have towards the development of a computerized system. It is

    common knowledge .

    Those computer installations have something to do with turnover, transfers, retraining

    and changes in employee job status. Therefore, it is understandable that the

    introduction of a candidate system requires special effort to educate and train the staff

    on new ways of handling the system. All along the above studies and discussion the

    users were actively involved and were keen to get a new system, which would eliminate

    all the problems in the existing system.

    The total project costs, priority, completion time and personnels required were

    estimated. Initial plans were drawn up to how the project would proceed to

    its final Implementation,while running the existing system so that companys

    information needs were not affected. Feasibility Study helps to determine performance

    and cost Effectiveness of the system, against the system performance requirements set

    prior to the feasibility study.

    5. SOCIAL FEASIBILITY

    People are inherently resistant to change, and computers have been known to facilitate

    change . An adverse reaction and resistance is always expected from the user staff. Ourcase is different .The users get the graphical displays of information which is quickly

    understandable than capturing the information from reports.

    6. TIME FEASIBILITY

  • 8/12/2019 15026057 Hospital Management c Code 123

    10/30

    Time feasibility is the determination of whether a proposed project can be implemented

    fully within stipulated time frame.

    STEPS IN FEASIBILITY ANALYSIS

    FEASIBILITY ANALYSIS INVOLVES EIGHT STEPS:-

    Form a project team and appoint a project leader.

    Prepare system flowcharts and Enumerate potential candidate systems

    Describe and identify characteristics of candidate systems.

    Determine and evaluate performance and cost effectiveness of each candidate system.

    Weight system performance and cost data then select the best candidate system.

    To produce periodic reports to management on the performance of the safe deposit

    department.

  • 8/12/2019 15026057 Hospital Management c Code 123

    11/30

    REQUIREMENT ANALYSIS

    After the feasibility study, the analyst takes the formal acceptance of the proposed

    system from the requested department. The next step is to study the current system in

    detail, so that the system requirements can be determined. Systems analysis, also called

    as Problem Analysis or Requirements Analysis is the obtaining of the actual

    specifications of the system by clearly understanding the needs of the users. After

    analysis, a document is prepared by the analyst, which is called as Software

    Requirement Specification (SRS) document. We will discuss the various parts

    and characteristics of an SRS in subsequent part.

    Many methods and languages have been developed for requirements analysis.

    Structured Analysis and Design Technique (SADT)simply called as

    Structured Analysis is the most commonly used method for analysis. We will

    discuss this method in detail in subsequent part. Problem Statement Language

    (PSL) and Requirements Statements Language (RSL) are some of the languages

    developed for specifying the requirements.

    PSL is fundamentally the same as the structured analysis, but it is purely textual whereas

    structured analysis uses both text and graphics. RSL has been specially designed for

    specifying the requirements of real time control systems.

  • 8/12/2019 15026057 Hospital Management c Code 123

    12/30

    The Initial Investigation

    A questionnaire is formed to find the need of change and the deficiencies of the

    existing system. A set of questions can be represented to the security staff and

    visitors which will help in understanding the types of requirements as the project

    under consideration is objective driven.

    Are you aware of the history of the visitors?

    Do you have the facility of storing the records of new visitors without

    need to access the various record .

    How tedious is to add a new visitor and make the desired changes in the

    desired record.

    Do you have enough staff to handle the project?

    Does the existing system need automation to enhance the information

    sharing and transparency.

    What is the mechanism of report generation?

    What are the added advantages of using automated system.

  • 8/12/2019 15026057 Hospital Management c Code 123

    13/30

    STRUCTURED ANALYSIS

    Structured analysis is a development method for analysis of existing system. It is a set of

    techniques that allow the analyst to design the proposed system. The main purpose of

    structured analysis is to completely understand the current system.

    Structured Analysis Tools

    DFD

    Data Dictionary

    Process Description

  • 8/12/2019 15026057 Hospital Management c Code 123

    14/30

    Tools of Structured analysis

    Data Flow Diagrams (DFDs):Data flow diagrams are widely used

    graphic tools for describing the movement of data within or

    outside the system. As a DFD consists of a series of bubbles joining

    by lines, it is also known as bubble chart.

    Data Dictionary:Data dictionary is an organized list of terms and their

    definitions for all the data elements and data structures that are

    pertinent to the system. It stores names along with their descriptions

    of all data used in a system.

  • 8/12/2019 15026057 Hospital Management c Code 123

    15/30

    Hardware requirements

    Minimum requirements: -

    Pentium i133MHz

    Ram 16 MB

    Hard disk 2.1 GB

    Recommended: -

    Pentium III

    Ram 128 MB

    Hard disk 10 GB

    Others: -

    PrinterColored Monitor

    Software requirements

    Operating System:-

    DOS, WINDOWS 98/XPCompiler :-

    TURBO C++ VER 4.0

  • 8/12/2019 15026057 Hospital Management c Code 123

    16/30

    LEVEL ZERO DFD

  • 8/12/2019 15026057 Hospital Management c Code 123

    17/30

    LEVEL -1 DFD

  • 8/12/2019 15026057 Hospital Management c Code 123

    18/30

    HEADER FILES

    stdio.h:-Defines types and macros needed for the Standard I/O Packagedefined in Kernighan and Ritchie and extended under UNIX

    System V. Defines the standard I/O predefined streams stdin,

    stdout, stdprn, and stderr, and declares stream-level I/O

    routines

    stdlib.h:-Declares several commonly used routines: conversionroutines, search/sort routines, and other miscellany.

    string.h:-Declares several string- and memory-manipulation routines.

    conio.h:-Declares various functions used in calling the DOS console I/O

    routines.

    dos.h:-Defines various constants and gives declarations neededfor DOS and8086-specific calls.

    Alloc.h:- to allocate memory at run time.

    process.h:-To perform mathematical operations in the code.

  • 8/12/2019 15026057 Hospital Management c Code 123

    19/30

    SYSTEM DEFINED FUNCTIONS

    clrscr():- clrscr clears the current text window and places thecursor in the upper left-hand corner

    gotoxy():- moves the cursor to the given position in the current

    text window.If the coordinates are invalid, the call to gotoxyis

    ignored.

    sleep():-With a call to sleep, the current program is suspendedfrom execution for the number of seconds specified by the argument

    seconds.

    getch():-getch reads a single character directly from

    the keyboard, without echoing

    to the screen.

    open():-Opens a file for an fstream

    Gets:-gets collects a string of characters terminated by a

    new line from the standard input stream stdin and puts it

    into s.

    Delay:- With a call to delay, the current program is

    suspended from execution for the time specified by

    the argument milliseconds.

  • 8/12/2019 15026057 Hospital Management c Code 123

    20/30

    CODING

    #include

    #include#include

    #include

    #include

    # include

    void module1(void);//function prototype for entering patient detail

    void module2(void);//function prototype for viewing patient detail

    void module3(void);//function prototype for doctors enquiry

    void module4(void);//function prototype for getting details about software

    void module5(void);//function prototype for taking feedback

    void module6(void);//function prototype for quitting the programme

    void module7();//function prototype for log in as administrator

    exit(void);//exit prototype for exit function

    void userchk(void);//function prototype for giving privilages between user and administrator

    char privilage='\0';

    void menu(void);//function prototype for calling the main menu

    struct patient

    {

    char p_id[10];

    char name[20];char sex[10];

    char age[4];

    char address[50];

    char diagnosis[200];

    char bloodgroup[10];

    char test[200];

    };

    void main()

    {

    printf("welcome to");printf("\n ***** Hospital Management Simulation ***** ");

    userchk();//module checks the user and administrator

    }

    void userchk()//module that differentiates user & administrator

    {

    char passuser[]={"hospital"};// password for user

    char passadmin[]={"authority"};//password for administrator

    char s1[15];//entered password of administratorint i=0;

    char ch='\0';

  • 8/12/2019 15026057 Hospital Management c Code 123

    21/30

    char s2[15];//entered password of user

    int us_choice;// choice between user and administrator

    int us_check; // varible that compare integers

    printf("\nenter choice\n 1 - administrator \n 2 - user \n");

    scanf("%d",&us_choice);

    if(us_choice==1){

    printf(" enter password\n");

    while(ch!=13)

    {

    ch=getch();

    s1[i++]=ch;

    printf("*");

    }

    s1[i-1]='\0';

    us_check = stricmp(passadmin,s1);// printf("us_check=%d",us_check);

    if(us_check==0)

    {

    printf("\nwelcome administrator");

    privilage = 'a';

    menu();

    //return;

    }

    else

    {

    printf("\nentered password is wrong\n");

    printf("\nPlease Choose the correct User Mode \n Enter

    correct password");

    userchk();

    }

    }

    if(us_choice==2)

    {

    printf("enter password\n");

    while(ch!=13)

    { ch=getch();

    s2[i++]=ch;

    printf("*");

    }

    s2[i-1]='\0';

    us_check = stricmp(passuser,s2);

    // printf("%d",us_check);

    if(us_check==0)

    {

    printf("welcome user");privilage = 'u';

    menu();

  • 8/12/2019 15026057 Hospital Management c Code 123

    22/30

    }

    else

    {

    printf("entered password is wrong");

    }

    }

    }

    void menu()

    {

    int choice;//choice for main menu

    int mm;// choice for the goto tag

    clrscr();

    printf("welcome to");

    printf("\n ***** Hospital Management Simulation ***** ");

    //main menu starts from hereprintf("\n ***********hospital management software***********");

    printf(" \n1 - Entering patient detail 2 - View patient detail ");

    printf(" \n3 - Doctors enquiry 4 - Details about software ");

    printf(" \n5 - Feedback 6 - Exit ");

    printf(" \n7- Change current User Mode");

    printf(" \n");

    n1:

    printf("\n enter choice");

    scanf("%d",&choice);

    switch(choice)

    {

    case 1 :

    printf("enter patient detail");

    module1();//module for enterting patient detail

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);

    if(mm==1)

    {

    menu();

    }else

    {

    break;

    }

    case 2 :

    printf(" view patient detail");

    module2();//module for veiwing existing patient detail

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);if(mm==1)

    {

  • 8/12/2019 15026057 Hospital Management c Code 123

    23/30

    menu();

    }

    else

    {

    break;

    }case 3 :

    printf("Welcome to doctor's enquiry section");

    module3();//module for doctors enquiry section

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);

    if(mm==1)

    {

    menu();

    }

    else{

    break;

    }

    case 4:

    printf("details about software");

    module4();// module for details about s/w n programmer

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);

    if(mm==1)

    {

    menu();

    }

    else

    {

    break;

    }

    case 5 :

    printf(" welcome to feedback section:");module5();// module for feedback

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);

    if(mm==1)

    {

    menu();

    }

    else

    {

    break;}

  • 8/12/2019 15026057 Hospital Management c Code 123

    24/30

    case 6 :

    printf("you are about to exit");

    module6(); // module for exit

    /* printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);if(mm==1)

    {

    menu();

    }

    else

    {

    exit();

    // break;

    }*/

    case 7 :

    printf("case 7");module7();

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);

    if(mm==1)

    {

    menu();

    }

    else

    {

    exit();

    // break;

    }

    default :

    printf("not valid");

    printf(" \nwould you like to goto the main menu");

    printf(" \n 1 - yes \t\t 0 - no\n\t");

    scanf("%d",&mm);

    if(mm==1)

    {

    menu();}

    else

    {

    break;

    }

    }

    }

  • 8/12/2019 15026057 Hospital Management c Code 123

    25/30

    void module1()//module for enterting patient detail

    {

    FILE *source;

    char another='y';

    struct patient detail;

    source=fopen("pat_det.dat","ab");while(another=='y' || another=='Y')

    {

    printf("\n Enter Details of a patient --\n");

    printf("\n Patient ID : ");

    fflush(stdin);

    gets(detail.p_id);

    printf("\n Name : ");

    fflush(stdin);

    gets(detail.name);

    printf("\n Sex : ");

    fflush(stdin);gets(detail.sex);

    printf("\n Age : ");

    gets(detail.age);

    printf("\n Bloodgroup : ");

    fflush(stdin);

    gets(detail.bloodgroup);

    printf("\n Address : ");

    fflush(stdin);

    gets(detail.address);

    printf("\n Diagnosis : ");

    fflush(stdin);

    gets(detail.diagnosis);

    printf("\n Test : ");

    fflush(stdin);

    gets(detail.test);

    if(source==NULL)

    {

    printf("\n Can not open file.");

    }else

    {

    // fprintf(source,"%s%s%s%s",detail->name,detail->p_id,detail->age,detail->sex);

    fwrite(&detail,sizeof(detail),1,source);

    fclose(source);

    }

    printf("\n Add another record (y/n) :");

    another=getche();

    }

    }

    void module2() //module for veiwing existing patient detail{

  • 8/12/2019 15026057 Hospital Management c Code 123

    26/30

    FILE *target;

    struct patient detail;

    char ch;

    //detail=(struct patient *)malloc(sizeof(struct patient));

    target=fopen("pat_det.dat","rb");

    if(target==NULL){

    printf("\n Can not open file");

    }

    else

    {

    while(fread(&detail,sizeof(struct patient),1,target)==1)

    {

    printf("\n%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",detail.p_id,detail.name,detail.address,detail.bloodgroup,d

    etail.diagnosis,detail.sex,detail.test,detail.age);

    //fseek(target,sizeof(struct patient),SEEK_CUR);}

    /* ch=fgetc(target);

    while(ch!=EOF)

    {

    printf("%c",ch);

    ch=fgetc(target);

    }*/

    fclose(target);

    }

    }

    void module3()//module for doctors enquiry section

    {int choice1;

    printf("\n choose respected medical field");

    printf("\n 1 - surgeon \t 2 - neurology ");

    printf("\n 2 - orthopaedics \t4 - eye specialist ");

    printf("\n 5 - ent \t 6 - physician ");

    printf("\n enter field for which you want to see consultation time ");

    scanf("%d",&choice1);

    if(choice1==1)

    {

    printf("the timings are 11:00");

    }else if(choice1==2)

    {

  • 8/12/2019 15026057 Hospital Management c Code 123

    27/30

    printf("the timings are 11:00");

    }

    else if(choice1==3)

    {

    printf("the timings are 11:00");

    }else if(choice1==4)

    {

    printf("the timings are 11:00");

    }

    else if(choice1==5)

    {

    printf("the timings are 11:00");

    }

    else if(choice1==6)

    {

    printf("the timings are 11:00");}

    else{

    printf("invalid choice please retype again");

    }

    }

    void module4()// module for details about s/w n programmer

    {

    printf("\n*****this section contains program n contact details*****");

    printf("\n hospital simulation software");

    printf("\n Company :- Iec infosystems\t\t \t Programmer :- Er. Singh,Mohit");

    printf("\n Front End :- 'c' \t\t \t Back End :- MS word,files");printf("\n Contact Address:-IEC COLLEGE OF ENGINEERING AND TECHNOLOGY\n \t\t

    Gr.Noida \n\t\t 201301");

    printf("\n Contact No.:-\t +919911243494,+919452948071");

    printf("\n Email : [email protected] \n \t [email protected]");

    printf("\n HOPE YOU LIKE IT");

    }

    void module5()// module for feedback

  • 8/12/2019 15026057 Hospital Management c Code 123

    28/30

    {

    char feed_check;

    FILE *feedback;

    char feed[2000];//limit for feedback

    printf(" \n You are welcomed for Feedback Section ");

    printf(" \n Let us describe you the Requisites for giving Feedback ");printf(" \n while the System is preparing itself for feedback ");

    printf(" \n You are required to write your feedback regarding in not more than ");

    printf(" \n 2000 characters,alphanumeic allowed and an space has its own value.");

    // printf("\n\n\n\n\n\n Now give your Feedback ");

    delay(1000);

    delay(1000);

    delay(1000);

    delay(1000);

    delay(1000);

    if(privilage=='u')

    { printf("\n\n\n\n\n\n\n\n Now give your feedback");feedback =fopen("feed.txt","w+");

    if(feedback==NULL)

    {

    puts("cannot open file");

    return;

    }

    fflush(stdin);

    gets(feed);

    fprintf(feedback,"%s",feed);

    fclose(feedback);

    }

    if(privilage=='a')

    {

    printf("\n welcome Administrator");

    printf("\n Please select a task to do");

    printf("\n a - to read feedback file \t b - append feedback for future

    visit\n\n\n\n\n\t");

    fflush(stdin);

    feed_check = getchar();

    if(feed_check=='a'){

    FILE *fopen(), *fp;

    int c , linecount;

    char filename[40], reply[40];

    clrscr();

    printf("Enter file name: ");

    fflush(stdin);

    gets( filename );

    fp = fopen( filename, "r" ); /* open for reading */

  • 8/12/2019 15026057 Hospital Management c Code 123

    29/30

    if ( fp == NULL ) /* check does file exist etc */

    {

    printf("Cannot open %s for reading \n",

    filename );

    exit(); /* terminate program */

    }

    linecount = 1 ;

    reply[0] ='\0' ;

    c = getc( fp ) ; /* Read 1st character if any */

    while ( c != EOF && reply[0] != 'Q' && reply[0] != 'q')

    {

    putchar( c ) ; /* Display

    character */

    if ( c == '\n' )

    linecount = linecount+ 1 ;

    if ( linecount == 20 )

    {

    linecount = 1 ;

    printf("[Press Return

    to continue, Q to quit]");

    gets( reply ) ;

    }

    c = getc ( fp );

    }

    fclose( fp );

    }

    if(feed_check=='b')

    {

    feedback =fopen("feed.txt","a+");

    if(feedback==NULL)

    {

    puts("cannot open file");

    return;}

    fflush(stdin);

    gets(feed);

    fprintf(feedback,"%s",feed);

    fclose(feedback);

    }

    }

    }

  • 8/12/2019 15026057 Hospital Management c Code 123

    30/30

    void module6() // module for exit

    {

    printf("\nPlease wait the program ends");/* delay(1000);

    delay(1000);

    delay(1000);

    delay(1000);

    delay(5000);*/

    exit();

    }

    void module7()// module for log in as administrator

    {userchk();

    }