Main Documentation of Mca

download Main Documentation of Mca

of 93

Transcript of Main Documentation of Mca

  • 8/2/2019 Main Documentation of Mca

    1/93

    1

    CONTENTS

    Chapter Page No

    1. Introduction 5

    1.1Introductionabout project 61.1.1 Project Title 6

    1.1.2 Project Description 61.1.3 Problem Definition 7

    1.1.4 Limitation of Manually System 7

    1.2 Need of Computerization of System 7

    1.3 Proposed Software 8

    1.4 Importance of the Work 8

    2. System Analysis 10

    2.1 Feasibility Study and its types 11

    2.1.1 Economic Feasibility 11

    2.1.2 Technical Feasibility 12

    2.1.3 Operational Feasibility 12

    2.2 Analysis Methodology (Types) 13

    2.2.1 Waterfall Model 13

    2.3 Choices of Platforms 16

    2.3.1 Software Platform 16

    2.3.2 Hardware Platform 17

    2.4 Software Used 18

    2.5 Hardware Used 18

  • 8/2/2019 Main Documentation of Mca

    2/93

    2

    3. System Design 19

    3.1 Design Methodology 20

    3.1.1 Input process output charts 20

    3.1.2Hierarchy Plus Input Process Output charts 21

    3.2 Database Design 22

    3.3 Screen Design 25

    3.4 Data Flow Diagram 37

    3.4.1 Data Flow Diagram 37

    3.4.2 Entity-Relationship Diagram 41

    4. Testing and Implementation 43

    4.1 Testing methodology 44

    4.2 Unit Testing 45

    4.3 System Testing 46

    4.4 Alpha/Beta Testing 48

    4.4.1 Alpha Testing 48

    4.4.2 Beta Testing 48

    4.5 White Box/Black Box Testing 49

    4.5.1 White Box Testing 49

    4.5.2 Black Box Testing 50

    4.6 Implementation 51

    5. Conclusion and References 52

    5.1 Conclusion 53

    5.2 Limitation of System 53

  • 8/2/2019 Main Documentation of Mca

    3/93

    3

    5.3 Future Scope of Modification 54

    5.4 System Requirements 55

    5.4.1 Hardware Requirements 55

    5.4.2 Software Requirements 55

    5.5 References/Bibliography 56

    6. Annexures 57

    6.1 Data Dictionary 58

  • 8/2/2019 Main Documentation of Mca

    4/93

    4

    LIST OF FIGURES

    Name of figure page no:

    E-R Diagram

    Alpha Testing

    Beta Testing

  • 8/2/2019 Main Documentation of Mca

    5/93

    5

    CHAPTER 1

    INTRODUCTION

  • 8/2/2019 Main Documentation of Mca

    6/93

    6

    1.1 INTRODUCTION ABOUT PROJECT1.1.1 Project Title

    Library Management System

    1.1.2 Project Description

    This software covers the requirements of the library in the world which is useful for those

    persons who want to gain knowledge and they are not interested in manual system. This

    project is developed by c programming. C is a programming language developed at AT &

    Ts Bell Laboratories ofUSA in 1972.It is reliable, simple and easy to use.

    Library management system is a software tool which is based on c language.

    Library Management is a computerized system which provides all the facilities of

    Library like advance booking, current booking, check out, cancellation, restaurant details,

    view of data details, room details and create a bill of customers.

    This software will be used by admin which is user so whatever customer want

    customer will tell his/her thing to user to be performed and user will take action.

    When user will do advance booking and current booking for customers so

    customer will get quest id and room no both will be unique and after that customer will

    be able to avail check-out (means when customer does not want to stay in hotel and want

    to leave hotel), cancellation (means customer want to cancel his/her booking) and

    restaurant facility if customer has valid quest id otherwise he/she cant avail facility.

    After checking-out of customer bill automatically will be generated

    according to customer charges (like food charges and room charges). The main reason to

    develop this software is data security it provides security of data of customers,

    Unauthorized person can not access this software unless know username and password

    and user can see all the details of customers

  • 8/2/2019 Main Documentation of Mca

    7/93

    7

    This project is fully user friendly. It provides a separate work for every function entries.

    From the main menu projects system provides choice entries to choose right choice to do

    perfect thing concern.

    1.1.3 Problem Definition

    In the existing system the booking transactions are done only manually but in proposed

    system we have computerized all the hotel transaction using the software Hotel

    Management System. Manual system is not good according to me because everyone can

    access it and play with details of customer. Actually manual system is not worked

    efficiently and effectively as well as time consuming as compared to computerized

    system .In manual system there can be human mistake while generating the bill of

    customer so that why we have come with computerized software to avoid mistake.

    1.1. 4 Limitation Of Manual System

    In the manual system the hotel transactions are done only manually The manual system

    is not sufficient as well as time consuming, Lack of security of data, consumes large

    volume of pair work, maintaining the improper record and also there is chances of human

    mistakes in manual calculations.

    1.2 NEED OF COMPUTERIZATION OF SYSTEM

    It is very compulsory that manual system should be computerized. If we talking about the

    manual system there are chances of error because its depends upon human skills means

    manual and also time consuming as well as lack of security of data so that why we need

    computerization of system. So that it will help largely in saving the costly time because it

    works some specified algorithms predefined already therefore there is less chance of

    errors in the system.

    The main things is that in manual system like hotel system

    unauthorized person can see and access data so there is no security of data but in

  • 8/2/2019 Main Documentation of Mca

    8/93

    8

    computerized system we have come with security of data that no one will be able to

    access the data unless he/she know username and password.

    1.3 PROPOSED SOFTWARE

    The manual system upon human skills means manual and also time consuming. The aim

    of proposed software is to develop a system of improved facilities. The proposed

    software can overcome all the limitations of the manual system. The system provides

    proper security and reduces the manual work and there is no tension to keep records

    because there is database which is file structure.

    The software is very simple in design and to implement. The software

    requires very low system resources and the system will work in almost all configurations.

    It has got following features.

    Security of data.

    Ensure data accuracys.

    Proper control of the higher officials.

    Minimize manual data entry.

    Minimum time needed for the various processing.

    Greater efficiency.

    Better service.

    User friendliness and interactive.

    1.4 IMPORTANCE OF THE WORK

    The importance of the work is this project works for hotels Hotel Management System"

    is a computerized system which provides all the facilities of hotels like advance booking,

    current booking, check out, cancellation, restaurant details, view of data details, room

    details and create a bill of customers.

  • 8/2/2019 Main Documentation of Mca

    9/93

    9

    The main importance of work of this software is that it will save the time of us to process

    the hotel transactions there is minimum time required for transactions .This software is

    user friendliness and interactive people can use it easily.

    When I consider the importance of good hotel management system needs a

    computer support to ensure data accuracy, greater efficiency. Better service as well as

    minimize manual data entry. Using this software we can access the transactions of hotel

    like advance booking(if room book in advance for customer), checkin(if room book in

    currently for customer) ,check-out(if customer wants to leave a hotel), cancellation(if

    customer wants to cancel his/her booking), restaurant facility, view data(we can see the

    records of customers).

  • 8/2/2019 Main Documentation of Mca

    10/93

    10

    Chapter 2

    System Analysis

  • 8/2/2019 Main Documentation of Mca

    11/93

    11

    2.1 FEASIBILITY STUDY OF SOFTWARE INCLUDES ITS TYPES

    Feasibility is defined as the practical extent to which a project can be performed

    successfully. To evaluate feasibility, a feasibility study is performed, which determines

    whether the solution considered to accomplish the requirements is practical and workable

    in the software or not Such information as resource availability, cost estimates for

    software development, benefits of the software to organization to organization after it is

    developed and cost to be incurred on its maintenance are considered.

    Some objectives of Feasibility study are;

    To analyses whether or not the software will meet organizational requirements To determine whether or not the software can be implemented using the current

    technology and within the specified budget and schedule.

    To determine whether or not the software can be integrated with other existingsoftware.

    2.1.1 Economic Feasibility

    Economic feasibility determines whether the required software is capable of generating

    financial gains for an organization or not. It involves the cost incurred on the software

    development team, estimated cost of hardware and software, cost of performing

    feasibility study, and so on for this, it is essential to consider expenses made on purchases

    and activities required to carry out software development. In addition, it is necessary to

    consider the benefits that can be achieved by developing the software.

    An economic feasibility assesses cost and benefits of the software,

    cost-benefit analysis are performed for it. Economic feasibility uses several methods to

    perform cost-benefits analysis, such as payback analysis, return on investment analysis

    and present value analysis.

    Our Proposed system is economically feasible because;

    The System works efficiently.

  • 8/2/2019 Main Documentation of Mca

    12/93

    12

    The system will provide a fast and efficient automated environment instead ofslow and manual system, thus reducing both time and manpower spent in running

    the manually system.

    The system will provide more efficient and catching error probability than manualsystem.

    2.1.2 Technical Feasibility

    Technical Feasibility assesses the current resources and technology, which are required to

    accomplish user requirements in the software within the allocated time and budget.

    For this, the software development team ascertains whether the current and

    technology can be upgraded or added in the software to accomplish specified user

    requirements. Technical feasibility performs the following tasks.

    It analyses the technical skills and capabilities of the members of softwaredevelopment team.

    It determines whether or not the relevant technology is stable and established.Our Proposed system is technically feasible because:

    The hardware and software required are easy to install and handle.

    2.1.3 Operational Feasibility

    Operational feasibility assesses the extent to which the required performs a series of steps

    to solve business problems and meet user requirements. This feasibility is dependent on

    human resources (software development team) and involves visualizing whether or not

    the software will operate after it is developed and be operated once it is installed. It also

    performs the following tasks:

    It determines whether or not the problems anticipated in user requirements are ofhigh priority.

    It analyses whether or not users will adapt to new software. It determines whether or not the organization is satisfied by the alternative

    solutions proposed by the software development team.

    I have done these types of feasibility while making this project.

  • 8/2/2019 Main Documentation of Mca

    13/93

    13

    2.2 ANALYSIS METHODOLOGY (TYPES)

    TYPES OF MODELS

    Waterfall model Prototyping model Spiral model

    2.2.1 Waterfall Model

    The simplest process model is the waterfall model, which states that the phase is

    organized in a linear order which is also called the linear sequential model. The model

    was originally proposed by Royce the model follows sequential approach from feasibility

    analysis phase to the maintenance phase of the SDLC. Waterfall model is the simplest

    where all the requirements are known before the system is developed. The various phases

    in this model are feasibility analysis, requirements analysis and specification, design,

    coding, testing and maintenance. The requirements analysis and specification phase to

    testing phase are known as developed phases.

    Each phase consists of well-defined activities to carry out the development process

    and at the end the work product is produced as an output of the phase.

    I am using Water Fall Model to develop this project. The water fall model is intuitively

    the most obvious way to develop the software.

    This water fall model divides the life cycle into the phases shown as .The main view

    behind using of waterfall model is that this project is not a big project. So by using

    waterfall model I can develop this software phase by phase more carefully.

  • 8/2/2019 Main Documentation of Mca

    14/93

    14

    Figure 2.1: The Waterfall Model

    The various phases included in the waterfall model are:

    Feasibility AnalysisThe feasibility analysis phase analyzes the technical and economic feasibility of the

    system. The technical feasibility of the system involves the analysis of system

    development environment, characteristics of the end user and system development

    environment, characteristics of the end user and system development resources, such as

    human resources and hardware systems. The economic feasibility of the system involves

    the analysis of system development cost with respect to the system quality.

    Feasibility

    Study

    Requirements

    analysis and

    specifications

    Design

    Coding and unit

    testing

    Integration and

    system testing

    Maintenance

  • 8/2/2019 Main Documentation of Mca

    15/93

    15

    Requirement Analysis And SpecificationIn the requirement analysis and specification phase, the key activity is to gather and

    understand the client requirements. The systems analyst analyses all the client

    requirements and remove all inconsistent and ambiguous requirements. The requirements

    which contradict each other are inconsistent and ambiguous .The client or project

    manager introduces consultant to describe the technical and application-specific

    requirements of the project.

    DesignIn the design phase, system designer translates requirements into various diagrammatic

    representations, such as flow chart, DFD, entity relationship diagram and UML diagrams.

    Structural design and object-oriented design are the two different system-design

    techniques.

    The design document is the work product of design phase. Design acts as input for the

    implementation of system in any suitable programming language System quality is

    evaluated by comparing the expected specification provided in design document with the

    observed behavior of the system.

    CodingCoding is the most important phase of SDLC .Software engineers implement the

    functionality specified in the design document into machine-readable programming

    language.

    TestingTesting is performed in order to ensure that the system is performing the same function as

    required by the client. In the testing phase, the software engineer conducts various types

    of testing, such as conditional testing, basis-path testing and boundary value analysis to

    uncover errors and bugs and fix these errors.

  • 8/2/2019 Main Documentation of Mca

    16/93

    16

    MaintenanceThe system maintenance phase performs activities after the deployment of system at the

    clients site. The maintenance of system includes defect removal and enhancement of the

    system as specified by the client. The three types of maintenance activities are corrective,

    perfective and adaptive maintenance .corrective maintenance finds the errors that were

    not discovered in the development phase. Perfective maintenance enables the system

    accommodate the changes suggested by the client. Adaptive maintenance enables the

    system to change its performing from one to another.

    2.3 CHOICE OF PLATFORMS

    2.3.1 Software platform

    1. Turbo c++ (C)

    Turbo c++ (c)

    Turbo c++ is software of c programming language that is used to make a project. C is

    programming language developed at AT & T Bell Laboratories of USA in 1972.It was

    designed and written by a man named Dennis Ritchie. In the late seventies C began toreplace the more familiar languages of that time like PL/I,ALGOL etc. No one pushed C.

    It wasnt made the official Bell Labs language. Thus, without any advertisement Cs

    reputation spread and its pool of users grew. Ritchie seems to have been rather surprised

    that so many programmers preferred C to older languages like FORTRAN or PL/I, or the

    newer ones like Pascal and APL.But,thats what happened

    Possibly why c seems so popular is because it is reliable, simple and easy

    to use.Out of the dozens of language available, the prize of purity is often given to

    PASCAl, Cs pretty sister. C wasnt meant to win prizes; it was meant to be friendly,

    capable and reliable. Therefore,quite a few programmers who begin by falling in love

    with pascal, end up happily married to C..

  • 8/2/2019 Main Documentation of Mca

    17/93

    17

    2.3.2 Hardware platform

    1. AMD Dual core Processor

    2. 1 GB RAM

    3. 160 GB Hard Disk

    4. 16color monitor

    2.4 SOFTWARE USED

    Here, the basic question is. It possible to build this application .first we must investigate

    the software to be used on the project. The main things is that software should be

    available to making this software package because if anyone software is not available for

    this application that is about to use in this application so that would be problem for us.

    Firstly we should have the software so that we will be able to develop this project

    because without getting the software we can not make our project and the software

    requirements for the development of this project are not many and are already available

    in the market.

    Our software has been used for this project are:

    1. Frontend: C Programming Language(turbo c++)

    2. Suport tool Backend: File

    3. Operating system: windows XP

    4. Application package: MS-Word 2007

  • 8/2/2019 Main Documentation of Mca

    18/93

    18

    2.5 HARDWARE USED

    Here the question about the hardware so hardware should be available according to

    software because some software needs high requirements of the hardware.

    Our Hardware has been used are:

    1. AMD dual core processor

    2. 1 GB RAM

    3. 160 GB Hard Disk

    4. 16color monitor

  • 8/2/2019 Main Documentation of Mca

    19/93

    19

    Chapter 3

    System Design

  • 8/2/2019 Main Documentation of Mca

    20/93

    20

    3.1 DESIGN METHODOLOGY

    The various design methodologies, such as IPO and HIPO charts are available that the

    system analyst can use to develop a good design of a system While developing the design

    for a system, the system analyst can determine the various design specifications, such as

    input/output subsystems, processing and database design. Therefore, choosing the

    appropriate tools and techniques helps the systems analyst to fasten the design process.

    The finished design should meet the end-user requirements and should also help in the

    proper maintenance of the system.

    To develop a good design, it is very important to select the best design

    methodology. Each design methodology has some good as well as bad points. Selection

    of design methodology depends on the size of the development time, the background and

    experience of analysts or designers, resources allocated to development, the type of

    application under development and the time allowance for the project.

    The following are the issues that should be considered while selecting the

    design methodology:

    Will it help the team to arrive at understanding of the system underdevelopment?

    Is it easy to learn and use? Will it serve user-analyst communication? What does it cost? What data structures does it use? What data flow and control features does it have? Is the technique manageable?

    .

    3.1.1: InputProcess Output Charts

    Information Processing (IP) implies that data is processed to provide information. The

    data can be numbers, words and graphics, which are then entered as input into a process

    to produce some output.

    A three column IPO chart shows the input and output requirements and the

    processing needed to provide the output, when the input is given.

  • 8/2/2019 Main Documentation of Mca

    21/93

    21

    The input and output columns contain information derived from the problem statement.

    The input column identifies the data, external to the process. Typically, this is a file

    composed of related fields, which in turn are composed of individual characters. You

    should identify the file names and the field names.

    The output column identifies what the process produces. Typically, this is a new data, a

    revised file or a report. If the output is new data, you should identify the file name and

    field names. If the output is a report, you should identify the unique lines of that report

    and any variable fields to be displayed.

    By using this information, you can determine the processing requirement. At

    this point of development few things can happen. First, you may determine that all the

    required output is either provided from input or can be developed from the input data.

    3.1.2: Hierarchy plus Input-Process-Output charts

    The HIPO is a graphic technique that can be used to describe a system. In this technique,

    a series of drawings are prepared by the analysts that show the function of the system

    starting with general overview diagrams and then proceeding to detailed diagrams of each

    specific function. Originally developed by IBM as a technique to document functions of

    programs, HIPO is commonly used today as a design tool during system development.

    The HIPO chart is a component of the structured approach that offers

    top-down or stepwise refinement sequences for developing modules. The HIPO was a

    component of this structured approach that offered top-down or stepwise refinements

    sequences for developing modules. The strengths of HIPO charts are that, it aids in

    structured programming and design, while the weakness are that it does not handle

    complexity in a manageable fashion.

    The HIPO diagrams begin with a hierarchy diagram, which is similar to an

    organization chart, in its tree-like structure. It defines the basic functions to be performed

    by the system and decomposes those functions into sub-sections. Preparation of HIPO

    diagrams begins with a series of meetings with the user about general expectations for the

    system, the desired output, various subsystems and the function performed by each

    subsystem. After that, HIPO diagram is built. Once the hierarchy diagram has been

    drawn, analysis review the system in the top-manner, looking once again at the different

  • 8/2/2019 Main Documentation of Mca

    22/93

    22

    functional levels to see if true functional decomposition exists and whether revisions to

    the structure of the hierarchy are necessary.

    3.2 DATABASE DESIGN

    A database is an organized mechanism that has the capability of storing information

    through which a user can retrieve stored information in an effective and efficient manner.

    The data is the purpose of any database and must be protected.

    The database design is a two level process. In the first step, user requirements

    are gathered together and a database is designed which will meet these requirements as

    clearly as possible. This step is called Information Level Design and it is taken

    independent of any individual DBMS.

    In the second step, this Information level design is transferred into a design for the

    specific DBMS that will be used to implement the system in question. This step is called

    Physical Level Design, concerned with the characteristics of the specific DBMS that will

    be used. A database design runs parallel with the system design. The organization of the

    data in the database is aimed to achieve the following two major objectives.

    Data Integrity Data independence

    Normalization is the process of decomposing the attributes in an application, which

    results in a set of tables with very simple structure. The purpose of normalization is to

    make tables as simple as possible. Normalization is carried out in this system for the

    following reasons.

    To structure the data so that there is no repetition of data, this helps in saving. To permit simple retrieval of data in response to query and report request. To simplify the maintenance of the data through updates, insertions, deletions. To reduce the need to restructure or reorganize data which new application

    requirements arise?

  • 8/2/2019 Main Documentation of Mca

    23/93

    23

    TABLE STRUCTUREField Data Type Constraints Description

    name[] Char Name of the

    customer

    address[] Char Address of

    customer

    landline_no[] Char Landline no of

    customer

    mobile_no[] Char Mobile no of

    customer

    guest_id int Primary key Guest id of

    customer

    checkin_date Time_t Time of check in

    checkout_date Time_t Time of check out

    cancelled_date[] Char Time of cancellation

    checkout_flag[] Char Checkout status

    checkin_flag[] Char Check in status

    booking_flag[] Char Booking status

    cancel_flag[] Char Cancellation status

    room_no Int Unique key a number of the

    every room in the

    hotel

    room_count Int Available rooms in

    the hotel

  • 8/2/2019 Main Documentation of Mca

    24/93

    24

    room_code

    room_name[]

    Char

    char

    A Code of every

    room in the hotel

    Name of every room

    in the hotel

    total_charges Double Total charges of

    customer

    room_charges Double Charges of room in

    the hotel

    food_charges Double Charges of food in

    the hotel

  • 8/2/2019 Main Documentation of Mca

    25/93

    25

    3.3 SCREEN DESIGN

    LOGIN

  • 8/2/2019 Main Documentation of Mca

    26/93

    26

    WELCOME

  • 8/2/2019 Main Documentation of Mca

    27/93

    27

    HOTEL HOME PAGE

  • 8/2/2019 Main Documentation of Mca

    28/93

    28

    ADVANCE BOOKING

  • 8/2/2019 Main Documentation of Mca

    29/93

    29

    CURRENT BOOKING

  • 8/2/2019 Main Documentation of Mca

    30/93

    30

    CHECK OUT FOR ADVANCE BOOKING

  • 8/2/2019 Main Documentation of Mca

    31/93

    31

    CHECK OUT AND AFTER BILL IS GENERATED

  • 8/2/2019 Main Documentation of Mca

    32/93

    32

    CANCELLATION FOR ADVANCE BOOKING

  • 8/2/2019 Main Documentation of Mca

    33/93

    33

    CANCELLATION FOR CURRENT BOOKING

  • 8/2/2019 Main Documentation of Mca

    34/93

    34

    RESTAURANT

  • 8/2/2019 Main Documentation of Mca

    35/93

    35

    VIEW DATA FOR GUEST DETAILS

  • 8/2/2019 Main Documentation of Mca

    36/93

    36

    VIEW DATA FOR CHECK OUT DETAILS

  • 8/2/2019 Main Documentation of Mca

    37/93

    37

    BACK TO HOME

  • 8/2/2019 Main Documentation of Mca

    38/93

    38

    3.4 REPORT DESIGN

    3.4.1 Data Flow Diagram

    A data-flow diagram (DFD) is a graphical representation of the "flow" of data through an

    information system. DFDs can also be used for the visualization of data processing

    (structured design).

    On a DFD, data items flow from an external data source or an internal data store to an

    internal data store or an external data sink, via an internal process.

    A DFD provides no information about the timing or ordering of processes, or about

    whether processes will operate in sequence or in parallel. It is therefore quite differentfrom a flowchart, which shows the flow of control through an algorithm, allowing a

    reader to determine what operations will be performed, in what order, and under what

    circumstances, but not what kinds of data will be input to and output from the system, nor

    where the data will come from and go to, nor where the data will be stored.

    DFD can be classified as physical DFD and logical DFD. A physical

    DFD is an implementation-dependent view of the current system, showing what functions

    are performed. Physical diagram shows how the system will be implemented, e.g. details

    about hardware, software, files and people involved. Physical characteristics include

    names of the people, names of departments ,names of files, names of hardware, locations,

    procedures, form names, document names etc.

    Logical DFD is an implementation-independent view of a system,

    focusing only on the flow of data between processes or activities. Logical diagrams show

    how the business operates, not how the system will be implemented. It describes each

    event and the data required

  • 8/2/2019 Main Documentation of Mca

    39/93

    39

    0 LEVEL DFD

    Verify username and password

    Username and password

    1 LEVEL DFD

    Admin Hotel

    Management

    System

    Hotel

    Home

    Admin Login

    Check in

    Hotel Home

    Booking

    Check out

    Cancellation

    Restaurant

    View Data

    Exit

  • 8/2/2019 Main Documentation of Mca

    40/93

    40

    Database

    2 LEVEL DFD

    Admin

    Check

    guest id

    Booking

    Hotel

    Home

    Check in

    Check out

    Cancellation

    Restaurant

    View Data

    Exit

  • 8/2/2019 Main Documentation of Mca

    41/93

    41

    Database

    3 LEVEL DFD

    Admin Hotel Home

    Check inCheck

    out

    Cancellation

    Check in

    BookingCheckout

    Bill

    Cancellation

    Restaurant

    View Data

    Exit

  • 8/2/2019 Main Documentation of Mca

    42/93

    42

    Database

    4 LEVEL DFD

    3.4.2 Entity-relationship Diagram

    An EntityRelationship diagram(ERD) is the graphical representation of the E-R model.

    You can describe logical structure of a database graphically, by using ERD.It uses

    various symbols to represent the relationship between the different entities of a system.

    Admin

    View Data

    Restaurant

    Exit

  • 8/2/2019 Main Documentation of Mca

    43/93

    43

    E-R Diagram

    Login

    Username password

    Hotel Home

    Want

    toBook

    Booking Advance

    Name Address

    Landline

    no

    Mobile

    no

    Room

    no

    Room

    Guest id

    CurrentGuest id

    Name

    Address

    Landline

    no

    Mobile

    no

    Check in

    flag

    Want to

    check

    out

    Check out for current

    booking

    Guest id

    Name

    Address

    Landline

    no

    Mobile

    no

    Check out

    flag

    Check in

    date

    Check out

    date

    Booking

    flag

    Room

    Room no

    Room

    charges

    Food charges

    Total charges

    Want

    to

    cancel

    Cancellation

    Guest id

    Cancelleddate

    Check inflag

    Cancel flag

    Want

    to eat

    food

    Restaurant

    Guest id

    Food charges

    Want

    to see

    data

    Room count

    Exit

  • 8/2/2019 Main Documentation of Mca

    44/93

    44

    CHAPTER 4

    TESTING

    AND

    IMPLEMENTATION

  • 8/2/2019 Main Documentation of Mca

    45/93

    45

    4.1 TESTING METHODOLOGY

    Software testing refers to an essential part of the software development process, which

    indentifies the correctness, completeness and quality of developed software. Its main

    objective is to detect errors in the software. Errors prevent software from producing

    outputs according to user requirement .Error occur when any aspect of a software product

    is incomplete, inconsistent or incorrect. Errors can be broadly classified into three types,

    namely requirements errors, design errors and programming errors. To avoid these errors,

    it is necessary that: requirements are examined for conformance to user needs, software

    design is consistent with requirements and notational convention, and source code is

    examined for conformance to the requirements specification, design documentation anduser expectations. All these can be accomplished through efficacious means of software

    testing.

    Software testing evaluates an attribute or a capability of a program or a

    system and ensures that it gives the required results. It should be noted that testing is

    fruitful only if it is performed in the correct manner. Through effective software testing,

    software can be examined for correctness, comprehensiveness, consistency and

    adherence to standards. This helps in delivering high-quality software products and

    lowering maintenance costs, thus leading to more contented users.

    Software testing is often used in association with the two terms, verification

    and validation, Verification is the process of ensuring that the software is developed

    according to its specifications. For verification, techniques such as reviews, analysis,

    inspections and walkthroughs are commonly used. While validation refers to the process

    of checking that the developed software meets the requirements specified by the user.

    Verification and Validation can be summarized thus:

    Verification: Are we developing the software rights?

    Validation: Are we developing the right software?

  • 8/2/2019 Main Documentation of Mca

    46/93

    46

    Software testing evaluates software by manual and automated means to ensure that it is

    functioning according to user requirements. Various advantages associated with testing

    are listed as follows:

    It removes errors that prevent software from producing outputsaccording to user requirements.

    It removes errors that lead to software failure. It determines whether the system meets business and user needs. It ensures that the software is developed according to user

    requirements.

    It improves quality of the software by removing maximum possibleerrors from it.

    4.2 UNIT TESTING

    Unit testing is performed to test the individual units of software. Since software is made

    of a number of units/modules, detecting errors in these units is simple and consumes less

    time, as they are small in size. However, it is possible that the outputs produced by one

    unit become input for another unit. Hence, if incorrect output produced by one unit is

    provided as input to the second unit, then it also produces wrong output. If this process is

    not corrected, the entire software may produce unexpected outputs. To avoid this, all the

    units in software are tested independently using unit testing.

    Unit level testing is not just performed once during the software

    development, but repeated whenever the software is modified or used in a new

    environment. The other points to be noted about unit testing are as follows:

    Each unit is tested in isolation from other parts of a program.

  • 8/2/2019 Main Documentation of Mca

    47/93

    47

    The developers themselves perform unit testing. Unit testing makes use of white box testing methods.

    Unit testing is used to verify the code produced during software coding and is responsible

    for assessing the correctness of a particular unit of source code. Unit testing performs the

    following functions:

    It checks all arithmetic calculations present in the unit with all possiblecombinations of input values.

    It ensures that the data entered in variables is of the same data type asdefined in the unit.

    It ensures that all statements in the unit are executed at least once. It checks the range of inputs given to units. This because every input

    range has a maximum and minimum value and the input given should

    be within the range of these values.

    It tests data structures that represent relationship among individual dataelements.

    4.3 SYSTEM TESTING

    The system testing as testing conducted on a complete and integrated system to evaluate

    the system compliance with its specified requirements.

    System testing makes a comparing of the system with the non-

    functional system requirements, including security, speed accuracy and reliability. The

    emphasis is on validation and verification of the functional design specifications and

    examination of how modules function together. System testing also does the evaluation

    of external interfaces to other applications and utilities or the operating environment.

  • 8/2/2019 Main Documentation of Mca

    48/93

    48

    During system testing, associations between objects control and infrastructure (such

    as time management and error handling), feature interactions or problems that arise when

    multiple features are in simultaneous use and compatibility between previously working

    software releases and new releases are tested. System testing also tests some properties of

    the developed software, which are essential for user. These properties are:

    Usable: It verifies that the developed software is easy to use and is understandable. Secure: It verifies that access to important or sensitive data is restricted even for

    those individuals who have authority to use the software.

    Compatible: It verifies that the developed software works correctly in conjunctionwith existing data, software and procedures.

    Documented: It verifies that manuals that give information about the developedsoftware are complete, accurate and understandable.

    Recoverable: It verifies that there are adequate methods for recovery in case offailure.

    System testing needs several test runs since it entails feature-by-feature

    validation of behavior, when a number of normal and erroneous test inputs and data

    are used.

    System testing is deemed to be complete when the actual results and

    expected results are either in line or in difference with the inputs specified by the

    user. The various types of testing performed as a part of system testing are recovery

    testing, security testing, stress testing and performance testing

  • 8/2/2019 Main Documentation of Mca

    49/93

    49

    4.4 ALPHA /BETA TESTING

    4.4.1 Alpha Testing

    It is done by the users at the site of the developer .This testing assesses the performance

    of software in the environment in which it is developed. On completion of alpha testing,

    users report the errors to software developers so that they can correct them. Note that

    alpha testing if often done in the form of internal acceptance testing.

    Customer Site

    Figure 4.1: Alpha Testing

    The Advantages of alpha testing are:

    It identifies all the errors present in the software.

    It checks whether or not all the functions mentioned in the requirementsare implemented properly in the software.

    4.4.2 Beta Testing

    It assesses the performance of software at the users site. This testing is live testing and is

    conducted in an environment not controlled by the developer means this testing is

    performed without any interference from the developer. Beta testing is performed to

    know whether or not the developed software satisfies the user requirements and fits

    within the business processes.

    Software

    Developer Site Customer Site

  • 8/2/2019 Main Documentation of Mca

    50/93

    50

    Customer Tests

    Figure4.2: Beta Testing

    Beta testing is often employed as form of external acceptance testing in order to acquire

    feedback from the market Often limited public tests, known as beta versions, are

    released to groups of people so that further testing can ensure that the end product has

    few faults or bugs. Sometimes, beta-versions are offered to the open public so that the

    feedback is increased.

    The advantages of Beta testing are:

    It evaluates the entire documentation of software. For example, itexamines the detailed description of software code, which forms a

    part of documentation of software.

    It checks whether or not software is operating successfully in userenvironment

    4.5 WHITE BOX AND BLACK BOX TESTING

    4.5.1. White Box Testing

    White box testing, also known as structural testing is performed to check the program

    internals. To perform this testing, the tester should have a thorough knowledge of the

    Software

    Customer SiteDeveloper Site

  • 8/2/2019 Main Documentation of Mca

    51/93

    51

    program code and the purpose for which it is developed. The basic strength of this testing

    is that the entire software implementation is included while testing is performed. This

    helps in detection of error even when the software specification is not clear or complete.

    The objective of white box testing is ensuring that the test cases exercise each

    path through a program, i.e., test cases ensure that all internal structures in the program

    are developed according to design specifications. The test cases also ensure that:

    All independent paths within the program have been executed at leastonce.

    All internal data structures are exercised for ensuring validity. All loops are executed at their boundaries and within operational

    bounds.

    All segments present between the control structures are executed atleast once.

    4.5.2 Black Box Testing

    In black box testing structure of the program is not considered. Test cases are decided

    solely on the basis of the requirements or specifications of the program or module, and

    the internals of the module or the program are not considered for selection of test cases.

    in Black-box testing, the tester only knows the inputs that can be given to the system and

    what output the system should give. In other words, the basis for deciding test cases in

    functional testing is the requirements or specifications of the system or module.

    This form of testing is also called functional or behavioral testing.

    The black box testing is used to find the following errors:

    Interface errors, such as functions, which are unable to send or receivedata to/form other software.

  • 8/2/2019 Main Documentation of Mca

    52/93

    52

    Incorrect functions that lead to undesired outputs when executed. Missing functions and erroneous data structures. Incorrect conditions due to which the function produce incorrect

    outputs when they are executed.

    In this testing, various inputs are exercised and the outputs are compared against

    specifications to validate the correctness. Note that test cases are derived from these

    specifications without considering implementation details of the code. The outputs are

    compared with user requirements and if they are as specified by the user, then the

    software is considered to be correct, else the software is tested for the presence of errors

    in it.

    4.6 IMPLEMENTATION

    This phase delivers the fully functioning operational software to the user. Once the

    software is accepted and deployed at the user end, various changes occur due to changes

    in external environment. These include upgrading new operating system or adding a new

    peripheral device. The changes also occur due to the changing requirements of the user

    and changes occurring in the field of technology .This phase focus on modifying

    software, correcting errors and improving the performance of the software.

    Actually Implementation is a process of ensuring that the information system is

    operational and then, allowing users to use and evaluate it. Implementing a system also

    involves training the users to handle the system. The systems analyst needs to plan for a

    smooth conversion from the old system to the new one by converting files from old

    formats to new ones. The total evaluation of the system is done in this final phase. After

    the system is installed, it must be maintained for the following two reasons.

    To find out system errors. To enhance the system capabilities.

  • 8/2/2019 Main Documentation of Mca

    53/93

    53

    CHAPTER 5

    CONCLUSION

    AND

    REFERENCES

  • 8/2/2019 Main Documentation of Mca

    54/93

    54

    5.1 CONCLUSION

    Hotel management system is a software tool which is based on c language. Hotel

    Management is a computerized system which provides all the facilities of hotels like

    advance booking, current booking, check out, cancellation, restaurant details, view of

    data details, room details and create a bill of customers.

    This software will be used by admin which is user so whatever customer want

    customer will tell his/her thing to user to be performed and user will take action.

    When user will do advance booking and current booking for customers so

    customer will get quest id and room no both will be unique and after that customer will

    be able to avail check-out (means when customer does not want to stay in hotel and want

    to leave hotel), cancellation (means customer want to cancel his/her booking) and

    restaurant facility if customer has valid quest id otherwise he/she cant avail facility.

    After checking-out of customer bill automatically will be generated

    according to customer charges (like food charges and room charges). The main reason to

    develop this software is data security it provides security of data of customers,

    Unauthorized person can not access this software unless know username and password

    and user can see all the details of customers

    Generally manual hotel management system has to face a lot of problems in these

    facilities. This all information has to be managed manually as well as time consumed so

    there is a need to develop a system that can solve the mentioned problem. This software

    comes with just that solution. This software has a some features to attract the people.

    Some features are: proper control of the higher officials, better service, greater efficiency

    and this software is user friendliness and interactive. It ensure that only authorized userscan access this software.

  • 8/2/2019 Main Documentation of Mca

    55/93

    55

    5.2 Limitation of system

    1. There is a fixed username and password.

    2. You can not change username and password in this software because its fixed

    3. We can not get a bill of customers by using this software.

    4. This software only shows Indian currency

    5. Luxury and service tax is not used in this software.

    6. This software does not show mode of payment options for pay a bill like credit card,

    debit card and cash.et

    7. This software will not check validation somewhere.

    5.3 FUTURE SCOPE OF MODIFICATION

    This software is developed in c programming by which in future any type of changes can

    be easily made. This project has a wide range of use in future. Much points at that that

    the most practical technology will be the one, which will enable error-proof identification

    of fingerprints. It has been known for more than a hundred years now that that pattern

    with no doubts whatever can identify their owners. Unfortunately construction of such a

    piece of equipment which will have the facility to perform this with equal accuracy to

    dactylographic specialists is not a simple task. The fingerprints option is very useful

    because if someone has an ATM card of another person might be possible he/she has

    stolen the ATM card and he/she knows the pin number and account number then he/she

    can misuse the service of that ATM card. So it is very useful that whenever someone

    insert the ATM card into ATM machine so that time persons will have to touch their

    fingers to ATM machine. They will have to do both these work at a same time.

  • 8/2/2019 Main Documentation of Mca

    56/93

    56

    I can say that this project can be work better for with modification in future and

    another enhancement can be done by our like to any kind of changes without any

    problem.

    Thus I can say that this project have a tremendous viability for future use.

    5.4 SYSTEM REQUIREMENTS

    5.4.1: Hardware Requirement

    1. Pentium 4 processor and above

    2. 256 MB RAM

    3. 40 GB Hard Disk

    4. Color monitor

    5.4.2: Software Requirement

    1. C Compiler

    2.Aplication package: windows xp /2007 /98

  • 8/2/2019 Main Documentation of Mca

    57/93

    57

    5.5 REFERENCES / BIBLIOGRAPHY

    In order to develop restaurant billing system, the following books and Website are

    referred.

    C Programming

    1. Let us C by Yashwant Kanetkar

    2. Programming ANSI C by E. Balaguruswami

    3. C Programming by Kerninghan and Ritchie -2nd edition

    4. The Art of C by H.Schildt

    Software Engineering

    1. An integrated Approach to Software Engineering Third Edition by pankaj Jalote

    2. Software engineering fifth edition by roger s pressman

    3. www.buzzle.com

    4. Rajeev mall Softwareengineering

    5.Data Base Management System: E-Balagursamy.

    http://www.buzzle.com/http://www.buzzle.com/
  • 8/2/2019 Main Documentation of Mca

    58/93

    58

    CHAPTER 6

    ANNEXURES

  • 8/2/2019 Main Documentation of Mca

    59/93

    59

    6.1 DATA DICTIONARY

    STRUCTURE NAME:GUESTTYPE

    Field Data Type Constraints Description

    name[] Char Name of the

    customer

    address[] Char Address of

    customer

    landline_no[] Char Landline no of

    customer

    mobile_no[] Char Mobile no of

    customer

    guest_id int Primary key Guest id of

    customer

    checkin_date Time_t Time of check in

    checkout_date Time_t Time of check out

    cancelled_date[] Char Time of cancellation

    checkout_flag[] Char Checkout status

    checkin_flag[] Char Check in status

    booking_flag[] Char Booking status

  • 8/2/2019 Main Documentation of Mca

    60/93

    60

    cancel_flag[] Char Cancellation status

    room_no Int Unique key a number of the

    every room in thehotel

    room_count Int Available rooms in

    the hotel

    room_code

    room_name[]

    Char

    char

    A Code of every

    room in the hotel

    Name of every room

    in the hotel

    total_charges Double Total charges of

    customer

    room_charges Double Charges of room in

    the hotel

    food_charges Double Charges of food in

    the hotel

  • 8/2/2019 Main Documentation of Mca

    61/93

    61

    coding

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #define BOOKING_CHARGES 1000

    int room_count=0;

    char booking_flag='F';

    struct guestType //270 bytes

    {

    char name[50];

    char address[50];

    char landline_no[20];

    char mobile_no[20];

    int guest_id;

    time_t checkin_date;

    time_t checkout_date;

    char cancelled_date[30];

  • 8/2/2019 Main Documentation of Mca

    62/93

    62

    char checkout_flag;

    char checkin_flag;

    char booking_flag;

    char cancel_flag;

    int room_no;

    int room_count;

    char room_code;

    char room_name[50];

    double total_charges;

    double room_charges;

    double food_charges;

    };

    int price[46]={245,245,260,250,240,240,240,240,235,235,250,235,235,

    220,215,230,215,240,250,250,250,250,250,250,250,255,245,245,150,180,

    100,50,30,40,35,50,60,30,50,45,40,45,25,35,60,50};

    char food[46][30]={"SHAHI PANEER","MALAI KOFTA","PALAK PANEER","MIX VEG.",

    "ALOO GOBI","ALOO JEERA","RAJMA MAKHANI","DAL MAKHANI","BUNDI RAITA",

    "SALAD(GREEN)","DUM ALOO","MUTTON MUGHLAI","MUTTON KORMA","MUTTON CURRY",

  • 8/2/2019 Main Documentation of Mca

    63/93

    63

    "KADAI MUTTON","KEEMA MATAR","EGG CURRY","BUTTER CHICKEN","KADAI CHICKEN",

    "CHICKEN MUGHLAI","CHICKEN MASALA","FISH CURRY","CHICKEN TIKKA",

    "SEEKH KABAB","FISH TIKKA","CHICKEN TANDOORI","PANEER TIKKA",

    "CHICKEN BIRYANI","PANEER PULAO","VEG.PULAO","JEERA RICE","RUMALI ROTI",

    "ROTI","NAN","PARANTHA","BUTTER NAN","MISSI ROTI","VEG.BURGER","MOMO'S",

    "PANEER BURGER","CHEESE SANDWICH","VEG.PATTI","TEA","COFFEE",

    "ICECREAM","COLDDRINK"};

    int valid_phone(char ph[20],char type) // 0 for invalid

    {

    int i,count=1;

    if(type == 'M')

    {

    if(ph[0] != '9' && ph[0]!='8'&& ph[0]!='7' )

    return 0;

    }

    else if(type == 'L')

    {

    if(ph[0] == '1')

    return 0;

    }

  • 8/2/2019 Main Documentation of Mca

    64/93

    64

    for(i=1;ph[i] && i

  • 8/2/2019 Main Documentation of Mca

    65/93

    65

    double difference;

    double one_day_sec,dbyo;

    int no_of_days=0,i,code=0;

    time_t t;

    long size;

    struct guestType data = {"\0","\0","\0","\0",0,0,0,"\0",'F','F','F','F',0,0,'\0',"\0",0.0,0.0,0.0 };

    size = sizeof(data);

    if((fp = fopen("newrec.dat","rb+"))==NULL)

    {

    if((fp = fopen("newrec.dat","wb+"))==NULL)

    {

    printf("File Cannot open output file.\n");

    exit(0);

    }

    }

    clrscr();

    switch(choice)

    {

    case '1':// BOOKING IN ADVANCE

  • 8/2/2019 Main Documentation of Mca

    66/93

    66

    if(data.room_count > 100)

    {

    printf("Rooms Are Not Available.\n");

    break;

    }

    more = 'Y';

    while(more == 'Y'|| more == 'y' )

    {

    rewind(fp);

    while((fread(&data,size,1,fp))==1);

    if(data.guest_id < 200 )

    data.guest_id = 200;

    else

    data.guest_id += 1;

    if(data.room_no < 8200 )

    data.room_no = 8200;

    else

    data.room_no += 1;

  • 8/2/2019 Main Documentation of Mca

    67/93

    67

    printf("\n\nPleas add a guest\n\n");

    printf("\nEnter The Required Data\n");

    printf("_______________________________\n\n");

    printf("\n Name :: ");

    gets(data.name);

    printf(" \n Address :: ");

    gets(data.address);

    printf(" \n Land Line Number :: ");

    gets(data.landline_no);

    valid_flag = valid_phone(data.landline_no,'L');

    if(!valid_flag){

    printf("\nlandline No Is Not Valid\n\n");

    getch();

    break;

    }

    printf(" \n Mobile Number :: ");

    gets(data.mobile_no);

    valid_flag = valid_phone(data.mobile_no,'M');

    if(!valid_flag){

    printf("\n mobile No Is Not Valid\n\n");

  • 8/2/2019 Main Documentation of Mca

    68/93

    68

    getch();

    break;

    }

    data.cancel_flag = 'F';

    while(1)

    {

    printf("\nPlease select a room to book in advance");

    printf("\n\nROOM TYPES \t"

    "CODES\tCHARGE PER DAY\n"

    "ROYAL SUITE \t1. \tRs 20,000\n"

    "SUPER DELUXE\t2. \tRs 15,000\n"

    "DELUXE \t3. \tRs 10,000\n"

    "DOUBLE BED \t4. \tRs 5,000\n"

    "SINGLE BED \t5. \tRs 2,000\n");

    printf("\nEnter the Room Code to Select Room");

    fflush(stdin);

    choice = getch();

    switch(choice)

    {

    case '1': strcpy(data.room_name,"ROYAL SUITE");

    data.room_charges = 20000;

    break;

  • 8/2/2019 Main Documentation of Mca

    69/93

    69

    case '2': strcpy(data.room_name,"SUPER DELUXE");

    data.room_charges = 15000;

    break;

    case '3': strcpy(data.room_name,"DELUXE");

    data.room_charges = 10000;

    break;

    case '4': strcpy(data.room_name,"DOUBLE BED");

    data.room_charges = 5000;

    break;

    case '5': strcpy(data.room_name,"SINGLE BED");

    data.room_charges = 2000;

    break;

    default : printf("\nPlease select correct room code\n\n");

    }

    if(choice=='1'||choice=='2'||choice=='3'||choice=='4'||choice=='5')

    {

    data.room_code = choice;

    break;

  • 8/2/2019 Main Documentation of Mca

    70/93

    70

    }

    }

    printf("\n\nROOM NUMBER :: %d\n\n",data.room_no);

    printf("\nGUEST ID :: %d\n\n",data.guest_id);

    printf("Do you wanna save this guest record(press n for no) : ");

    fflush(stdin);

    save_flag = getche();

    if(save_flag != 'n' && save_flag != 'N')

    {

    if(booking_flag == 'C')

    {

    time(&data.checkin_date);

    data.booking_flag='C';

    data.checkin_flag='T';

    }

    else

    {

    data.booking_flag='A';

    }

    data.room_count+=1 ;

  • 8/2/2019 Main Documentation of Mca

    71/93

    71

    booking_flag = 'F';

    fwrite(&data,sizeof(data),1,fp);

    }

    printf("\n\nDo you wann add more guests: ");

    more = getche();

    }

    break;

    case '2': // CHECK IN

    printf("\n\n Have You Booked in Advance ?(press n for no) : ");

    fflush(stdin);

    more_book_flag = getche();

    if(more_book_flag == 'y' || more_book_flag == 'Y')

    {

    printf("\n\nEnter guest_id : ");

    scanf("%d",&guestid);

    rewind(fp);

    found=0;

    while(fread(&data,sizeof(data),1,fp))

    {

  • 8/2/2019 Main Documentation of Mca

    72/93

    72

    if(data.guest_id == guestid)

    {

    printf("\n Guest Id = %d\n",data.guest_id);

    printf("\n Name = %s\n",data.name);

    printf("\n Address = %s\n",data.address);

    printf("\n Landline Number = %s\n",data.landline_no);

    printf("\n Mobile Number = %s\n\n",data.mobile_no);

    time(&data.checkin_date);

    data.checkin_flag = 'T';

    fseek(fp,-size,1);

    fwrite(&data,size,1,fp);

    found = 1;

    break;

    }

    }

    if(found==0)

    {

    printf("This guest Id does not exist.\n");

    printf("Enter a valid guest Id.\n");

    }

    printf("\n\nPress any key to continue...");

    getch();

  • 8/2/2019 Main Documentation of Mca

    73/93

    73

    }

    else

    {

    printf("\n\nThen You have to book first.");

    booking_flag = 'C';

    getdata('1');

    }

    break;

    case '3' : //CHECK OUT

    printf("\n\nEnter your guest Id : ");

    scanf("%d",&guestid);

    rewind(fp);

    found=0;

    while(fread(&data,sizeof(data),1,fp))

    {

    if(data.guest_id == guestid)

    {

    found=1;

    if(data.checkin_flag == 'F')

  • 8/2/2019 Main Documentation of Mca

    74/93

    74

    {

    printf("\nNOTE: You cannot checkout unless you checkin\n");

    break;

    }else{

    printf("\n\n\t\t\t-----------------BILL-----------------\n"); // bill generated

    printf("\n\t\t\tGuest Id = %d\n",data.guest_id);

    printf("\n\n\t\t\tName = %s\n",data.name);

    printf("\n\t\t\tAddress = %s\n",data.address);

    printf("\n\t\t\tLandline Number = %s\n",data.landline_no);

    printf("\n\t\t\tMobile Number = %s\n",data.mobile_no);

    printf("\n\t\t\tCheckin Time = %s\n",ctime(&data.checkin_date));

    time(&data.checkout_date);

    printf("\n\t\t\tCheckout Time = %s",ctime(&data.checkout_date));

    data.checkout_flag = 'T';

    if(data.booking_flag=='A')

    printf("\n\t\t\tAdvance Booking\n");

    else if(data.booking_flag == 'C')

    printf("\n\t\t\tCurrent Booking\n");

    printf("\n\t\t\tRoom Type = %s\n",data.room_name);

    printf("\n\t\t\tRoom Number = %d\n",data.room_no);

    if(data.booking_flag == 'A')

    printf("\n\t\t\tAdvance Booking Charges = %d\n",BOOKING_CHARGES);

    printf("\n\t\t\tRoom Charges = %.2lf\n",data.room_charges);

  • 8/2/2019 Main Documentation of Mca

    75/93

    75

    printf("\n\t\t\tFood charges = %.2lf\n",data.food_charges);

    difference = difftime(data.checkout_date,data.checkin_date);

    one_day_sec = 24 * 60 * 60;

    dbyo = difference/one_day_sec;

    no_of_days = ceil(dbyo);

    printf("\n\t\t\tNo. Of Days : %d\n\n",no_of_days);

    data.total_charges = 0;

    data.total_charges += (data.room_charges * no_of_days + data.food_charges);

    if(data.booking_flag=='A')

    data.total_charges += BOOKING_CHARGES;

    printf("\n\t\t\tTotal Charges = %.2lf\n",data.total_charges);

    data.room_count-=1;

    fseek(fp,-size,1);

    fwrite(&data,size,1,fp);

    }

    break;

    }

    }

    if(found == 0)

    printf("\n\nThis Guest Id Does not exist");

    printf("\n\nplease press any key ...");

  • 8/2/2019 Main Documentation of Mca

    76/93

    76

    getch();

    break;

    case '4' : //CANCELLATION

    printf("\nPlease enter guest Id for cancellation\n");

    scanf("%d",&guestid);

    rewind(fp);

    found=0;

    while(fread(&data,sizeof(data),1,fp))

    {

    if(data.guest_id == guestid)

    {

    found = 1;

    if(data.checkin_flag == 'F')

    {

    time(&t);

    strcpy(data.cancelled_date,ctime(&t));

    data.cancel_flag='T';

    data.room_count-=1;

    fseek(fp,-size,1);

    fwrite(&data,sizeof(data),1,fp);

    printf("\n\tYour Advance Booking has been cancelled.\n\n");

    break;

  • 8/2/2019 Main Documentation of Mca

    77/93

    77

    }

    else

    {

    printf("This record can not be cancelled.\n");

    printf("Advance booking can be cancelled.\n");

    printf("If guest is checked in.\n\n");

    break;

    }

    }

    }

    if(found==0){

    printf("This guest Id does not exist.\n");

    printf("Enter a valid guest Id.\n\n");

    }

    printf("\n\nPress any key to continue...");

    getch();

    break;

    case '5' : printf("Welcome to Restaurant\n");

  • 8/2/2019 Main Documentation of Mca

    78/93

    78

    clrscr();

    printf("\t\t\t*** MENU CARD ****\n\n");

    for(i=0;i

  • 8/2/2019 Main Documentation of Mca

    79/93

    79

    data.food_charges = 0;

    printf("Enter the codes of item you want .\n");

    printf("Press 0 after selection\n\n");

    while(1)

    {

    printf("code %d: ",i++);

    fflush(stdin);

    scanf("%d",&code);

    if(code == 0)

    break;

    data.food_charges += price[code-1];

    }

    fseek(fp,-size,1);

    fwrite(&data,sizeof(data),1,fp);

    }

    }

    if(found==0)

    {

    printf("This guest Id does not exist.\n");

    printf("Enter a valid guest Id.\n\n");

    }

    getch();

  • 8/2/2019 Main Documentation of Mca

    80/93

    80

    break;

    case '6': // VIEW DATA

    while(fread(&data,sizeof(data),1,fp))

    fseek(fp,0l,1);

    printf("\n\tAvailable Rooms = %d\n",(100-data.room_count));

    printf("---------------------------------------------\n\n");

    printf("\tWhich Information You Wanna View\n\n");

    printf("\t1. Guests Details\n");

    printf("\t2. Check Out Details\n");

    printf("\t3. View All Details\n");

    printf("\t4. Back to Home \n\n");

    printf("choice = ");

    while(1)

    {

    choice = getche();

    checkout_flag = 'z';

    switch(choice)

    {

    case '1' : checkout_flag = 'F';cancel_flag='F';break;

    case '2' : checkout_flag = 'T';cancel_flag='F';break;

    case '3' :

    case '4' : break;

  • 8/2/2019 Main Documentation of Mca

    81/93

    81

    default : printf("\nselect correct option\n");

    }

    if(choice == '1' ||choice == '2' ||choice == '3' ||choice == '4')

    break;

    }

    if(choice == '4') break;

    rewind(fp);

    while(fread(&data,sizeof(data),1,fp))

    {

    if(choice == '3'){

    checkout_flag = data.checkout_flag;

    cancel_flag = data.cancel_flag;

    }

    if(data.checkout_flag == checkout_flag )

    {

    if(data.cancel_flag == cancel_flag)

    {

    printf("\n----------------------------------------\n\n");

    printf("Guest Id = %d\n\n",data.guest_id);

    printf("Name = %s\n\n",data.name);

    printf("Address = %s\n\n",data.address);

  • 8/2/2019 Main Documentation of Mca

    82/93

    82

    printf("Landline Number = %s\n\n",data.landline_no);

    printf("Mobile Number = %s\n\n",data.mobile_no);

    // printf("checkin flag = %c\n\n",data.checkin_flag);

    if(data.booking_flag=='C')

    printf("checkin time = %s\n\n",ctime(&data.checkin_date));

    if(data.checkout_flag=='T')

    printf("checkout time = %s\n\n",ctime(&data.checkout_date));

    // printf("Checkout Flag = %c\n\n",data.checkout_flag);

    // printf("Cancel Flag = %c\n\n",data.cancel_flag);

    printf("Booking Status = %c\n\n",data.booking_flag);

    printf("Room Name = %s\n\n",data.room_name);

    printf("Room Number = %d\n\n",data.room_no);

    printf("Room Charges = %.2lf\n\n",data.room_charges);

    printf("food charges=%.2lf\n\n",data.food_charges);

    printf("Total charges = %.2lf\n\n",data.total_charges);

    printf("\n----------------------------------------\n\n");

    fflush(stdin);

    getch();

    }

  • 8/2/2019 Main Documentation of Mca

    83/93

    83

    }

    }

    clrscr();

    break;

    case '7' : fclose(fp);

    exit(0);

    break;

    default : printf("You Pressed a wrong key..");

    getch();

    }

    fclose(fp);

    }

    void login()

    {

    char password[4];

  • 8/2/2019 Main Documentation of Mca

    84/93

    84

    char username[5];

    int i;

    clrscr();

    gotoxy(31,5);

    printf("-----------------");

    gotoxy(33,7);

    textcolor(BLACK);

    textbackground(CYAN);

    cprintf("please login");

    gotoxy(31,9);

    printf("-----------------");

    while(1)

    {

    printf("\n\n\n\n enter the username: ");

    scanf("%s",username);

    printf("\n enter the password: ");

    for(i=0;i

  • 8/2/2019 Main Documentation of Mca

    85/93

    85

    printf("\n\n\n\n\n\t\t\t\t login successful");

    break;

    }

    printf("\n\n please enter correct username and password");

    }

    getch();

    }

    void welcome()

    {

    clrscr();

    gotoxy(35,10);

    textcolor(BLACK);

    // textbackground(RED);

    printf("WELCOME");

    delay(2000);

    gotoxy(37,18);

    textcolor(BLACK+BLINK);

    // textbackground(RED);

    cprintf("TO");

    delay(2000);

    gotoxy(28,26);

    textcolor(BLACK);

  • 8/2/2019 Main Documentation of Mca

    86/93

    86

    // textbackground(RED);

    printf("HOTEL INTERCONTINENTAL");

    getch();

    }

    char option_page()

    {

    char choice;

    printf("\n\n\t\t\t-------------Hotel Home------------");

    printf("\n\n1: Booking");

    printf("\n2: CheckIn");

    printf("\n3: CheckOut");

    printf("\n4: Cancellation");

    printf("\n5: Restaurant");

    printf("\n6: View Data");

    printf("\n7: Quit\n");

    fflush(stdin);

    choice = getche();

    return choice;

    }

  • 8/2/2019 Main Documentation of Mca

    87/93

    87

    void main()

    {

    char choice;

    login();

    textcolor(BLACK);

    textbackground(CYAN);

    welcome();

    textbackground(WHITE);

    clrscr();

    while(1)

    {

    choice = option_page();

    getdata(choice);

    }

    getch();

    }

  • 8/2/2019 Main Documentation of Mca

    88/93

    88

  • 8/2/2019 Main Documentation of Mca

    89/93

    89

  • 8/2/2019 Main Documentation of Mca

    90/93

    90

  • 8/2/2019 Main Documentation of Mca

    91/93

    91

  • 8/2/2019 Main Documentation of Mca

    92/93

    92

  • 8/2/2019 Main Documentation of Mca

    93/93