Sie sind auf Seite 1von 139

HOTEL MANAGEMENT SYSTEM

A Minor Project Report Submitted for the partial fulfilment of Masters of Computer Applications (5 years integrated course)

Under the supervision of: Mr Shivendra Kumar

Submitted by: HIMANSHU GUPTA Roll No.07031202014

Directorate of Distance Education Guru Jambheswar University of Science and Technology, Hisar 125001 (2007-2011)

DECLARATION
I hereby declare that the minor project work entitled HOTEL MANAGEMENT SYSTEM submitted for the MCA (5yrs course) is my original work carried out by me under the guidance of Mr Shivendra Kumar for the partial fulfillment of the award of the degree of the Masters of Computer Applications. The matter embodied in this report has not submitted anywhere else for the award of any other degree/diploma.

Place: Delhi Date: 29/12/2009

Signature of the candidate HIMANSHU GUPTA

CERTIFICATE
This is to certify that Mr HIMANSHU GUPTA, Regn. No.07031202014 has worked under my supervision to prepare his project report entitled HOTEL MANAGEMENT SYSTEM. The work embodied in this report is original and was conducted at TIAS from 12/12/09 to 27/1/10.This work has not been submitted in part or full to this or any other university for the award of any other degree or diploma.

Signature of Supervisor : Name : Mr Shivendra Kumar Designation :Lecturer Organization/Institute : Tecnia Institute Of Technology

Forwarded by Head, Study Centre (With signature, Name of Head and Seal)

LIST OF FIGURES
S NO. No. 1. Fig 1 Context level DFD ..35 Figure No Description of Figures Page

2 ..36

Fig 2

DFD for open a Room

Fig 3

DFD for check-out of customer

..37

Fig 4

DFD for record modification

..38

Fig 5

DFD for check out of customer

..39

Fig 6

DFD for listing of customer

..40

Fig 7

DFD for generating a bill of customer

..41

Fig 8

DFD for list of all records

..42

Fig 9

E-R Model for Hotel Management

..43

10

Fig 10

E-R Modal for checking a room record

..44

11

Fig 11

E-R Modal for bill generation

..44

12

Fig 12

Flowchart for hotel management system

..47

LIST OF ABBREVIATION
DFD OOPS ER DIAGRAM Data flow diagram Object oriented programming system Entity Relationship Diagram

TABLE OF CONTENTS
1. Introduction 1.1.

8 9

Objective

2. Problem Selection

10
3. Project Monitoring System

11
4. System Study

13
4.1.

Systems 13
4.1.1. Existing Systems 4.1.2. Proposed Systems

....13 14

4.2.

Feasibility Study
4.2.1. Technical Feasibility 4.2.2. Economical Feasibility

15 15

16
4.2.3. Operational Feasibility

16
4.3.

Feasibility Analysis Report 17

4.4. 4.5.

System specification Object Oriented System Development


4.5.1. Introduction 4.5.2. Advantages Of OOPS 4.5.3. Features of OOPS 4.5.4. Identification Of Needs

19 ...20 21 22 22 26 . .

5. System Analysis

.28
5.1. 5.2. 5.3. 5.4. 5.5.

Computerization Decision Analysis Approach Identification Of Need Needs Of Computerization Benefits Of Computerization

28 28 28 29 29 31 31 31 32 32 33 43 45

6. System Design 6.1. 6.2. 6.3. 6.4. 6.5. 6.6. 6.7.

Input Design Output Design Interface Design Procedural Design Data Flow Diagrams E-R Models Flow Charts

7. System Testing And Implementation 7.1.

49 49 50 50 51 51 52

Testing
7.1.1. Unit Testing 7.1.2. System Testing 7.1.3. Testing Strategies

7.2.

Implementation
7.2.1. Parallel System 7.2.2. Direct Conversion

...52
7.2.3. Pilot System 7.2.4. Phase In Method 8. Coding 9. Documentation

52 53 54

..131
9.1.

User Documentation ..131

9.2.

System Documentation ..132

10. Conclusion

..133
11. Scope of project

..134

References ..135 Appendix ..136

INTRODUCTION

In this project that is HOTEL MANAGEMENT SYSTEM prepared, we are dealing with the concept of the generation of the room status, billing detail status of various customer in the hotel. This system is based on the admission of customer into the hotel. This is principally and solely a final bill generation utility and is a Post Transaction System. This means, that the transaction being fed into the System, have already been executed. We start with the authentication of user for the security purpose. The next step is to enter the record of the customer and then we proceed to renter his room no, ward no and other details. After the customer and rooms details, and transaction details are recorded, the automated system automatically posts each record to their respective heads. This software records daily expenses incurred on the customer details in form of TRANSACTION ENTRY, classifies these transactions to the respective heads automatically, summarize these transactions in the form of various expenses 9

heads. Beside all these basic requirements of hotel billing it also generates the reports like annual result which is useful to take annual decisions and is helpful to analyze the comfort of the concerned customer.

The concerned hotel is one of the premire in providing excellent hopitality and healthcare services in areas like mumbai and delhi and is a fast growing hotel organisation with technical tie up from USA, UK, Australia & Germany for providing latest industry . It maintains excellent rapport and provides fine comfort to its customer.

OBJECTIVE OF THE PROJECT The set of the objectives that the software caters to are as stated below: Electronically handling of customer details to enhance the accuracy, flexibility, reliability and to remove the human errors. To permit the indiscipline of entering records at random and to permit easy retrieval of any information. To provide the accurate information about the customer room no ,modified details,result on the basis of informationand deletion of records To keep track of customer and staff . To provide annual report customer to provide online

10

To provide the efficient, accurate, reliable, fast, and robust structure that can handle any number of hotel transactions. For a customer program is divided into following basic modules:1. CHECK IN 2. CHECK OUT 3. CUSTOMER RECORD 4. ROOM RECORD 5. EDIT 6. REPORT 7. HELP 8. EXIT

PROBLEM SELECTION
One must know what the problem is before it can be solved. The basis for a candidate system is recognition of a need for improving an information system or a procedure. For example, a supervisor may want to investigate the system flow in purchasing or a main user has been getting complaints about the long lines in the drive-in. This need leads to a preliminary survey or an initial investigation to determine whether an alternative system can solve the problem. It entails looking into the duplication of effort bottlenecks, inefficient existing procedures, or whether parts of the existing system would be candidates for computerization. If the problem is series enough, management may want to have analyst look at it. Such an assignment implies a commitment, especially it the analyst is hired from the outside. In larger environments, where formal procedures are the norm, the analysts first task is to prepare a statement specifying the scope and objective of the problem. He/she then reviews it with the user for accuracy. At this stage, only a rough ball park estimate of the development cost of the project 11

may be reached however, an accurate cost of the next phase- the feasibility study can be produced.

PROJECT MONITORING SYSTEM


Projects management is technique used by a manager to ensure successful completion of a project. It includes the following function Estimating resource requirements Scheduling tasks and events Providing for training and sites preparation Selecting qualified staff and supervising there work Monitoring the projects program Documenting Periodic evaluating Contingency planning From these functions, we can see that project management is a specialized area. It involves application of planning, organization, and control concepts to critical, one of the kind projects. Its also uses tools and software packages for planning and managing each project. Managing projects also require the following: 12

Top management commitment to setting project priorities and allocating resources to approved projects. Active user participation to identify information needs, evaluate proposed improvements on a cost/ benefit basis, provide committed resources, and be receptive to training when scheduled.

A long range plan that includes general project priorities, objectives, schedules, and required resources Included in this is pressure from users who require the systems

department to accept impractical tasks or deadlines. The result is rushed, compromised projects, contrary to good system development practices. A further difficulty found in many organizations occurs when individual departments acquire microcomputers without knowing about their requirements or consulting with the centralized computer facility. The result is often uncoordinated confusion that makes it difficult to plan or control project

SYSTEM STUDY
In any hotel there are several types of records to handle all things like the entire customers name, address, their room details and other transaction details, which person has taken the room etc and about the bill records like room bill,food bill and all other things. So if we store all these records manually then there is very difficult to keep save the records and time consuming and less accuracy. If we search any record then it is also very hard. With the help of computers, this entire complicated task has become much simpler and easy to handle. It has become user friendly and easily understandable. Time consumed is less. Data is fed to the computers and can be stored there for the desired time. Output is derived in most effective manner. There are very few errors made and all the limitations of manual handling are removed with the help of computers.

13

The system study is indented with the study of the existing system, which is the current data base system, the working of the system, the concerned modules, and requirements etc. It also deals with the benefits and disadvantages of the system. We must thoroughly understand the old system and determine how computers can best be used to make its operations more effective. Before development of any project can be pursued, a system study is conducted to learn the details of the current business situation. Information gathered through the study, forms the basis for creating alternative design strategies. Management selects the strategy to pursue. 4.1 Systems 4.1.1 Existing System The existing system is studied to know the extent of computerization required. Therefore, a detailed analysis of the existing system should be conducted. For this purpose, system should be broken down into various subsystems and these subsystems were analyzed closely to identify the problem areas. As we studied the existing system, it was found that there was multiple File Management system which gives the facility for accessing the Banking details. In a File Management all works are done manually. The main problem of the manual operation is, it is time consuming and error prone than the computerized system. There was no efficient system to manipulate the existing records. The problem I observe in this area is that the user has to do all the operations manually, by searching and analyzing large amount of data, a miss spelled digit or character may create many hours of extra work and complicated correction procedure. Necessary data validation checks are included to avoid mistakes

14

4.1.2 PROPOSED SYSTEM The existing system leads to many errors like data redundancy, data inconstancy, and also much more paper works that waste very valuable time and money. We collect a lot of information from different current tools and its advantages. Keeping this in mind we decided to develop a software and named as Banking Management System which is very userfriendly and helps to make research a real chore. This computerization improves efficiency of office work, and also helps to keep data too many years without damage and can be recollected as and when needed without much time The Proposed system solves problems related to data accessing problems, because it help the user to add details of the customer to the bank database easily, improving data recovery speed, easy searching and also provide editing of datas in the database. 4.2 Feasibility study: Security is the keyword of the big institution. They have their own document very confidential and need that authorized users only be able to access the document. Further document generally passes through many persons, so security is must which can be provided by software. So, for this, software must be feasible according to different aspects. In the Feasibility study the system is tested for the following aspects: 1) Technical Feasibility 2) Financial/Economical Feasibility 3) Operational feasibility 4.2.1 Technical Feasibility: 1) With the concept of checkout, document security is increased a lot, because only the users who have checked out the document can modify the document, which is not possible with manual system even without content management. 15

2) Searching functionally for the document is provided so that searching for the document can be done easily. Otherwise in searching for the document can be havoc. Giving partial information if the complete information is unknown can search similar documents. 3) Different classes are provided so that the documents are stored according class. If the class is different and all the other information is same about document than even it is consider document. Different classes can be created for these different organizations. Earlier a separate database has to maintain for this, which has very time consuming and difficult task. 4) Data is stored at a common server so that documents are not scattered in the different places. 5) This project provides the facility of new user facility so that only only user concerned with it can access data. 4.2.2 Economical Feasibility: 1) Reduced processing time, which results in saving man-hours and processing. 2) This system not prone to errors; if the error arises then they are detected and interpreted accordingly, so this given more accuracy. 3) Thus system being more users friendly, as it is menu driven and thus does not require a special operator and this also resulting in saving of manhours. 4) Software can be modified according to need of company, and can be sold accordingly. 5) The system uses advance technology it is a long life system. 6) It is very easy to modify the system and adding new features. 7) This software can use for any organization need for any content management. 8) It is highly secured system trapping the system is almost impossible and it adds the security of the organization. 4.2.3 Operational Feasibility: 16

1) 2) 3)

Creation of documents of the different types is very easy. Users face problem with managing the different versions It is generally a cumbersome task to manage the

Otherwise the user should fill the form manually. of document, but with this project it is not so. document, which is processed by many users, but this project provides the checkout facility. 4) 5) 6) To manage a document many users use this. Creating, updating is very easy with this project Security to data stored is provided.

4.3 Feasibility analysis report: Feasibility analysis report is a formal document for management use and is prepared by system analyst after feasibility study. The report generally contains the following sections: COVERING LETTER: It is formally presents the report with a brief description of the project problem solving with recommendation to be considered. TABLE OF CONTENTS: It lists the section of feasibility study report along with their page numbers. OVERVIEW: It presents the overview of the projects problem along with the purpose and scope of the project. DESCRIPTION OF EXISTING SYSTEM: A brief description of the existing system along with its deficiencies is presented in this section. SYSTEM REQUIREMENT: The system requirements, which are either derived from the existing system or from the discussion with the users, are presented in this section. 17

DESCRIPTION OF PROCESSED SYSTEM: It presents a general description of the proposed system, highlighting its role in solving the problem. DEVELOPMENT PLAN: It presents a detailed plan with starting and completion dates for different phase of SDLC.A complementary plan is also needed for hardware and software evaluation, purchase and installation. TECHANICAL FEASIBILITY FINDINGS: It presents the finding of technical feasibility study along with recommendations. COST AND BENEFITS: The detailed finding of cost and benefits analysis is presented in this section. OPERATIONAL FEASIBILITY FINDINGS: It presents the findings of operational feasibility along with the human resource requirements to implement the system. ALTERNATIVE (CONSIDERATION / REJECTED): The different

alternatives that an analyst usually considers and rejects during feasibility study should also be included in the feasibility study report. COST / BENEFIT ANALYSIS: Since cost plays quite an important role in deciding the new system. It must be identified and estimated properly. Costs vary by type and consist of various distinct elements. Benefits are also of different and can be grouped on the basis of advantages they provide to the management. The benefits of a project include four types: Cost saving benefits Cost avoidance benefits Improved service level benefits Improved information benefits 18

Cost saving benefit lead to reduction in administration and operational costs. A reduction in the size of the clerical staff used in the support of an administrative is an example of a cost saving benefit.

4.4 System Specification


In order to present the project all the modules are expressed and defined for the following rail reservation system. Its not an easy task to create a project. For me also it was difficult and time consuming. While making the project I have kept two things in consideration. Hardware configuration System configuration

4.4.1 Hardware Configuration The hardware configuration is the details of the system and various other hardware and devices used while making this project. The hardware configuration of my system is as follows:
Processor -- Pentium III Processor speed -- 600 MHz Monitor Size -- 15 SVGA RAM -- 128 MB HDD -- 20 GB Floppy drive -- 1.44 MB

19

Memory Card -- 128 MB Keyboard -- 104 or higher Cache -- 512 KB Level 2 Cache Printer -- Laser Modem -- 56.6 Kbps UPS -- 0.5 KV

4.4.2 Software Configuration The development and designing of the project does not only depend on the hardware configuration but also the software we have choosed for designing the project. By the word software we mean the language we use to design our project. I have choosed the TurboC software for designing the project and the language used is the C++ language which is one of the most popularly used Object Oriented Programming Language. 4.5. OBJECT ORIENTED SYSTEM DEVELOPMENT 4.5.1. INTRODUCTION Object oriented Programming emphasized on the data rather than the algorithm. In the OOP, data is compartmentalized or encapsulated with the associated functions and this compartment or capsule called an object. In the OO approach, the problem is divided into functions. OO language allows localization of data and code and restricts other objects from referring to its local region. OOP is centred around the concepts of objects, encapsulations, abstract data types, inheritance, polymorphism, message based communication, etc. An OO language views the data and its associated set of functions as an object and treats this combination as a single entity. Thus an object is visualized as a combination of data and functions, which manipulate them. 20

During the execution of a program, the objects interact with each other by sending messages and receiving responses. An object communication with other objects need not be aware of the internal working of the objects with which it interacts. An object can be manipulated through an interface that responds to a few messages. The objects internal structure is totally hidden from the user and this property is called data/information hiding or data encapsulation. The external interfaces are implemented by providing a set of methods, each of which accepts and responds to a particular kind of message. The methods defined in an objects class are the same for all objects belonging to that class but, the data is unique for each object. Many object oriented analysis and object oriented design methodologies have emerged recently although the concepts underlying object orientation as a programming discipline has been developed long time ago. Object oriented methodologies represent a radical change over conventional methodologies such as structured analysis. Various object-oriented methodologies can be best investigated by dividing them into two camps revolutionaries and synthesizes. Revolutionaries believe that object orientation is a radical change that renders conventional methodologies and ways of thinking obsolete. Synthesizes view object orientation as simply an accumulation of sound software engineering principles, which adopters can graft onto their existing methodologies with relative ease. The revolutionaries state the following: There should be no doubt that OOD is fundamentally different from traditional structured design approaches, it requires a different way of thinking about decomposition, and it produces software architectures that are largely outside the realm of the structured design culture. There is no doubt one could arrive at the same results using different methods; same time but it is revealed that from experience that the thinking process, the discovery process, and the communication between the user and analyst are fundamentally different with OOA than with structured analysis. 21

On the other side the synthesiss states the following: Object oriented structured design methodology is essentially an elaboration of structured design. They state that the foundation of OOSD is structured design, and that structured design includes most if the necessary concepts and notations for OOSD. There is no doubt that object orientation has been touted as a revolutionary approach is a complete break with the past. OOA is a refinement of some the best software engineering ideas of the past. The design of an object appears over a sequence of stages. Its helpful to have this perspective because you stop expecting perfection right away; instead you realize that the understanding of what an object does and what it should look like happens over time. This view also applies to the design of various types of programs; the pattern for a particular type of program emerges through struggling again and again with that problem. Objects too have their patterns that emerge through understanding, use and reuse. 1. OBJECT DISCOVERY: This stage occurs during the initial analysis of a program. Looking for external factors and boundaries, duplication of elements in the system, and the smallest conceptual units may discover objects. Some objects are obvious if you already have a set of class libraries. Commonality between classes suggesting base classes and inheritance may appear right away, or later in the design process. 2. OBJECT ASSEMBLY: As we are building an object we will discover the need for new members that didnt appear during discovery. The internal needs of the object may require other classes to support it. 3. SYSTEM CONSTRUCTION: Once again, more requirements for an object may appear at this later stage. As you learn you evolve our objects. The need for communication and interconnection with other objects in the system may 22

change the needs of our classes or require new classes. For example we may discover the need for facilitator or helper classes, such as a linked list, that contain little or no state information and simply help other classes function. 4. SYSTEM EXTENSION: As we add new features to a system we may discover that your previous design doesnt support easy system extension. With this new information, you can restructure parts of the system, possibly adding new classes or class hierarchies. 5. OBJECT REUSE: This is the real stress test for a class. If someone tries to reuse it in an entirely new situation, they will probably discover some shortcomings. As you change a class to adapt to more new programs, the general principles of the class will become clearer, until you have a truly reusable type. However dont expect most object from a system design to be reusable-it is perfectly acceptable for the bulk of your object to be systemspecific. Reusable types tend to be less common, and they must solve more general problems in order to be reusable.

4.5.2. ADVANTAGES OF OBJECT ORIENTED PROGRAMMING.

Simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear. Modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system. Modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods.

Extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones.

Maintainability: objects can be maintained separately, making locating and fixing problems easier. 23

Re-usability: objects can be reused in different programs.

4.5.3. FEATURES OF OBJECT ORIENTED PROGRAMMING It is necessary to understand some of the concepts used extensively in object - oriented programming. These include: Objects Classes Data Abstraction and encapsulation Inheritance Polymorphism Dynamic binding Message Passing We shall discuss these concepts in some detail in this Section. Objects Objects are the basic run time entitles in an object oriented system. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle. They may also represent user defined data such as vectors, time and lists. Programming problem is analyzed in terms of objects and the nature of communication between them. Program objects should be chosen such that they match closely with the real world objects. Objects take up space in the memory and have an associated address like a record in Pascal, or a structure in C. When a program is executed, the objects interact by sending message to one another. For example, if customer and account are two objects in a program, then the customer object may send a message to the account object requesting for the bank balance. Each object contains data, and code to manipulate the data. Objects can interact without having to know details of each others data or code. It is sufficient to know the type of message accepted, and the 24

type of response returned by the objects. Although different authors represent them differently, shows tow notations that are popularly used in object oriented analysis and design. Classes We just mentioned that objects contain data, and code to manipulate that data. The entire set of data and code of an object can be made a user defined data type with the help of a class. In fact, objects are variables of the type class. Once a class has been defined, we can create any number of objects belonging to that class. Each object is associated with the data of type class with which they are created. A class is thus a collection of objects of similar type. For example, mango, apple and orange are members of the class fruit. Classes are user defined data types and behave like the built in types of a programming language. The syntax used to create an object is no different than the syntax used to create an integer object in C. If fruit has been defined as a class, then the statement. Fruit mango; Will create an object mango belonging to the class fruit Data Abstraction and Encapsulation The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Data encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions, which are wrapped in the class, can access it. These functions provide the interface between the objects data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding. Abstraction refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, weight and cost, and functions to operate on these attributes. They encapsulate all the essential properties of the objects that are to be created. The attributes are

25

sometimes called data members because they hold information. The functions that operate on these data are sometimes called methods or member functions. Since the classes use the concept of data abstraction, they are known as Abstract Data Types (ADT). Inheritance Inheritance is the process by which objects of one class acquire the prosperities of objects of another class. It supports the concept of hierarchical classification. For example, the bird robin is a part of the class flying bird, which is again a part of the class bird. The principle behind this sort of division is that each derived class shares common characteristics with the class from which it is derived as illustrated. In OOP, the concept of inheritance provides the idea of reusability. This means that we can add additional features to an existing class without modifying it. This is possible by deriving a new class from the existing one. The new class will have the combined features of both the classes. The real appeal and power of the inheritance mechanism is that it allows the programmer to reuse a class that is almost, but not exactly, what he wants, and to tailors the class in such a way that it does not introduce any undesirable side effects into the rest of the classes. Note that each sub class defines only those features that are unique to it. Without the use of classification, each class would have to explicitly include all of its features. Polymorphism and Overloading Polymorphism is another important OOP concept. Polymorphism, a Greek term, means the ability to take more than one form. An operation may exhibit different behaviour in different instances. The behaviour depends upon the types of data used in the operation. For example, consider the operation of addition. For two numbers, the operation will generate a sum. If the operands are strings, then the operation would produce a third string by concatenation. The process of a

26

making an operator to exhibit different behaviours in different instances is known as operator overloading. Illustrates that a single function name can be used to handle different number and different types of arguments. This is something similar to a particular word having several different meanings depending on the context. Using a single function name to perform different types of tasks is known as function overloading. Polymorphism plays an important role in allowing objects having different internal structures to share the same external interface. This means that a general class of operations may be accessed in the dame manner even though specific actions associated with each operation may differ. Polymorphism is extensively used in implementing inheritance. Dynamic Binding Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (also known as late binding) means that the code associated with a given procedure call is not known until the time of the call at run time. It is associated with a polymorphic reference depends on the dynamic type of the reference. Inheritance every object will have this procedure. Its algorithm is, however, unique to each object and so the draw procedure will be redefined in each class that defines the object. At run time, the code matching the object under current reference will be called. Message Passing An object oriented program consists of a set of objects that communicate with each other. The process of programming in an object oriented language, therefore, involves the following basic steps. 1. Creating classes that define objects and their behaviour. 2. Creating objects from class definitions, and 27

3. Establishing communication among objects. Objects communicate with one another by sending and receiving information much the same way as people pass messages to one another. The concept of message passing makes it easier to talk about building systems that directly model or simulate their real world counterparts. A message for an object is a request for execution of a procedure, and therefore will invoke a function (procedure) in the receiving object that generates the desired result. Message Passing involves specifying the name of the object, the name of the function (message) and the information to be sent. Objects have a life cycle. They can be created and destroyed. Communication with an object is feasible as long as it is alive.

4.5.4. IDENTIFICATION OF NEEDS Object-oriented programming promises to solve many key problems of software engineering like reuse, extensibility, and maintainability. Adding to the initial costs of software purchase are often considerable software maintenance costs. Object-Oriented Software Construction gives a breakdown of these costs, based on a survey of 487 installations developing various application software. The high percentage of changing user requirements is not surprising in view of the rapid technology changes and increasing user expectations. The high costs involved reflect on conventional software and its inability to cope with change. Software quality aspects can be grouped into internal and external quality factors. The internal quality factors apply to the "inner workings" of software modules such as modularity or readability, and are generally of not much concern to the end user of the software, unless the user is concerned with self-developed extensions. Of more importance for the end user are external factors such as:

28

Correctness: - The ability of software products to exactly perform their tasks, as defined by the requirements and specifications. Robustness: - The ability of software systems to function even in abnormal conditions. Extendibility: - The ease with which software products may be adapted to changes of specifications. Reusability: - The ability of software products to be reused, in whole or in part, for new applications. Compatibility: - The ease with which software products may be combined with others.

SYSTEM ANALYSIS
5.1 Computerization This step involves collection, recording, verification and analysis of how the operations are being carried out presently. System analysis is carried out with the objective of developing an effecting computers-based procedure, which will create benefits far excess of those available from others means. System analysis is the activity, which is used to sort out the area prospective for computerization and then determining the data volume and information requirement for each selected application. There are various approaches to conduct the information analysis.

5.2 Decision analysis approach: Identify objectives and/ or current decision or processes. Identify or formulate a decision making process. Identify the data necessary for the decision model or the process model. Specify the accuracy any availability of limits for the needed. 29

5.3 Identification of need In an era where the computers are becoming immensely a necessity among corporate and public sectors, it is important that a system should be in place which can take care of processes that an termed as tedious and time consuming. Computerization of different departments, location, offices etc. are being done. Apart from improving the work environment, It also ensures that the outdated methods of working a done away with new technical ways. The department of finance, which is undoubtedly one of the most important department and its functioning too have realized long before that computers are necessary components in an office environments. The various departments had not only welcomed but also embraced the changes that are essential and they are continuing to do so by converting most of there spread sheets and paper work to a computer based one. The need of a computer application or program is of the foremost necessity to many departments who still are using the old techniques for their procedure. The successful transition from paper file based to computer-based process can be witnessed in many departments and it acts as a good reference to those who wants to follow the suit. The manual means of keeping records of each and every student along with their bio-data and necessary details has resulted in: Errors in Calculations Poor Reproduced of record. Loss of money Decrease in Efficiency. This project has removed these problems by computerizing the calculations and hence removing any scope of errors. The project handles all kind of problem by all kind of problem by computerizing all records and other related areas about the student such as there register no., fee structures, different courses and all others type of details. Hence resulting in better record keeping facility along with efficient usage of time.

30

5.4 Needs of computerization Computerization is needed to remove the bottlenecks and limitation of the existing system. Some of the important merits of computerizations are: Better customer services Improved staff efficiency and reduced workload. Fast access of information Increase the capability of handling data Increasing the organizational revenue Higher reliability Provide security aspects.

5.5 Benefits of Computerization After the computerization of billing system the problem can be removed to a great extent, for example: Response time will be reduced i.e. time to generate a bill is just a time a user will take to click a button. The work load of the staff is currently very high, will be reduced Improved customer satisfaction Easy accessing of records and maintaining security.

31

SYSTEM DESIGN
The system design exercises make high-level decision about the overall architecture of the system. The system design phase provides the understanding and the procedural detail necessary for implementing the system recommended study. The target system is arranged into sub- systems based upon the analyzed structure and proposed architecture. The design process translates requirement into a representation of software that can be accessed for the quality before the code generation begins. The system design decides the system parameters, which must optimize, choose a strategy of solving the problem, and makes tentative resource allocations. The design phase covers the following procedures: Review of the current physical system.

32

Preparation of input specification, which includes the determining of the flow of data from the input data source to the actual input location.
o Preparation output specification

6.1 Input Design In input design, the userdefined inputs are converted in to computerbased format. Input design involves determining the record media, method of input, speed of capture and entry to the system. The most important approach to the input design is formatted and prompt design. 6.2 Output Design Computer output is the most important and direct source of information to the user. Designing the computer output should proceed in an organized, well through out manner. The right output must be developed while ensuring that each output element is designed so that people will find the system easy to use efficiently. When analysts design computer output they identify the specific output that is needed to meet the information requirements. Different methods for the information will be selected. Analyst creates document, report, or other format that contain information produced by the system 6.3 Interface Design Interface design mainly focuses on the design of interfaces betinterfaces, sometimes called intermodular interface design, is driven by the data that must flow between modules and the characteristics of the programming Language in which the software is to be implemented. External interface design begins with an evaluation of each external entity represented in the DFDs of the analysis model. Both internal and external interface design must be coupled with data validation and error handling algorithms within a module. Because side effects propagate across program interfaces, it is essential to check all data flowing from module to module to ensure that the data conform to bounds established during requirements analysis. User interface design has as much to do 33

with the study of people as it does with technology issues. Who is the user? How does the user learn to interact with a new computerbased system ? So the system should be developed in a userfriendly manner. 6.4 Procedural Design A procedural design reduces complexity, facilitates change (a critical aspect of software maintainability), and results in easier implementation by encouraging parallel development of different parts of a system. Software with effective modularity is easier to develop because function may be compartmentalized and interfaces are simplified. Software architecture embodies modularity, that is, software is divided into separately named and addressable components called modules, which are integrated to satisfy problem requirements. Modularity is the single attribute of software that allows a program to be intellectually manageable. Monolithic software ( i.e., a large program comprised of a single module) cannot be easily grasped by readed 6.5 DATA FLOW DIAGRAMS DFD is an important tool used by system analysts. The main merit of DFD is that it can provide an overview of what data a system would process, what transformations of data are done, what files are used, and where the results flow. The graphical representation of the systems makes it a good communication tool between a user and analyst. DFDs are structured in such a way that starting from a simple diagram which provides a broad overview at a glance, they can be expanded to a hierarchy of diagrams giving more and more details Square: Source or Destination of data (External Entity)

As we name suggests, they do not fall with in system boundary. Hence they are defined as source or destination of data. 34

Rounded rectangle/circle: Process

This can be defining as place where transformation of data takes place. This transformation includes addition modification, deletion or accumulation of data. Open ended Rectangle /Parallel lines: Data store

This symbolically represents a place where data is stored. The data can be stored for future processing (or) it can be processed for future reference. Any place where data is stored is called data store.

Data flow can take place 1. 2. 3. Between processes File to process External entity to process

35

CONTEXT LEVEL DFD HOTEL MANAGEMENT SYSTEM

ROOM

CUSTOMER

HOTEL MANAGEMENT

36

CUSTOMER CHECK OUT

PRINT DEVICE

Fig 1: Context level DFD DATA FLOW DIAGRAM OPENING A NEW ROOM

CUSTOMER

1.GENERATING NEW ROOM NO.

FILE

1.1 DISPLAY FORM

PROCESS Update table 1.2 GET DETAILS 37

Customer Document

1.4 UPDATE

1.3 OPEN ROOM

Fig 2: DFD for open a room

DATA FLOW DIAGRAM CHECK-IN OF A NEW CUSTOMER

CUSTOMER

1.Assigning a new room no.

FILE

1.1 Display form

Process

Update table

1.2 Get details

38

Customer details

1.4 Update

1.3 Assigning a room

Fig 3: DFD check in of a new customer

DATA FLOW DIAGRAM RECORD MODIFICATION

USER

1.Read the customer room no. Scan record

2. Show details of record

FILE

Processing

Update

39

3. Modify details of record

Fig 4:DFD for Record modification

DATA FLOW DIAGRAM CHECK-OUT OF CUSTOMER

Customer

1.Scan the customer room no.

FILE

s Process Update table 1.1 Display form

40

Customer details

1.4 Update

1.2 Get details

Fig 5: DFD for check-out of customer

DATA FLOW DIAGRAM LISTING OF CUSTOMERS

FILE scan record 2.select record from a database

Customer

1.Read the room no.

3.copy selected code

Processing s

6.copy selected record

4.comput e total

Processing 41 5.select record

OUTPUT

7.comput e bill Final output To screen/printer Fig 6:DFD of listing of customer DATA FLOW DIAGRAM GENERATING BILL OF CUSTOMER FILE MANAGEMENT no Scan room 1.Read room no.

8.Generate total list

OUTPUT UNIT

2.Check for check out of customer Update

Processing

4.Close database

42

3.Compute bill

CASH CUSTOMER

Fig 7:DFD for generating bill of customer DATA FLOW DIAGRAM LIST OF ALL RECORDS FILE Scan all record MANAGEMENT 1.Read the Request 2.Select record from file

Processing

3.Copy selected record

7.Copy selected record 43

4.Compute total

output Processing

5.Select record

7.Compute bill FINAL OUTPUT

8.Generate total list

To screen/printer OUTPUT UNIT Fig 8:DFD for list of all Records


6.6 E-R MODEL DIAGRAM

Data-centered models have existed in the world of database design since 1976 when Peter Chen published his paper on the entity-relationship model (Chen, 1976). Shortly afterwards, in 1979 the dataflow diagram was established (e.g. DeMarco, 1979) and in the early 1980s the entity-life history evolved (Rosenquist, 1982). Typically details of the entities, dataflows and processes are recorded in a data dictionary. All of these models use as their basic concept the motion of a data item or data element. The structure of the domain is abstracted as a network of entities and the functions of the domain by a network of dataflows and processes. Other representation associated with the data-centred approach includes state transition diagrams (which come in a variety of guises). These focus on the data which is necessary to move the system from one state to another.

Customer Hotel

44

Room inform ation

Check in

Room

Fig 9: ER-MODEL FOR HOTEL MANAGEMENT

Hotel

Room Recor d

Customer

Fig 10: ER-MODEL FOR CHECKING A ROOM RECORD

Customer

Checkout 45

Room

Bill Generatio n

Hotel

Fig 11:ER-MODEL FOR BILL GEMERATION

6.7 FLOW CHARTS

Start

Enter the choice 1-Add Records 2-Display the details 3-Delete 4-Modify 5- Search 0-Exit

If choice=1

no 46

Yes Enter the Code no

If integer

no

Enter the class yes 1,2,3

Name

If choice=2

no

Yes Enter the Name no

47

yes

Enter the code 1-8 bit code

Display List

If choice=3 Yes Enter the Char.

no

If Char==yes

no

Yes Delete record 48

If choice=0

no

Yes exit print press a key

Print invalid output stop

FIG 12: FLOWCHART FOR HOTEL MANAGEMENT SYSTEM

49

SYSTEM TESTING AND IMPLEMENTATION


7.1 Testing: Testing is a major quality control measure used during software development. Its basic function is to detect errors in the software. During requirements analysis and design the output is a document that is usually textual and non-executable after the coding phase, computer programs are available that can be executed for testing purposes. This implies that testing not only has to uncover errors introduced during coding, but also errors introduced during the previous phase. Thus the goal of testing is to be uncovering requirement, design 50

and coding errors in the programs. Consequently, different levels of testing are used. The starting point of testing is Unit testing. In this, a module is tested separately and is often performed by the coder himself simultaneously along with the coding of the module. The purpose is to exercise the different parts of the module code to detect coding errors. After this, the modules are gradually integrated into subsystem, which are then integrated eventually from the entire system. During integration of modules, integration testing is performed to detect design errors by focusing on testing the interconnection between modules. After the system is put together, system testing is performed; here the system is tested against system requirements to see if all the requirements are met and if the system performs as specified by the requirement. Finally real life data of the client is the operation of the system. Testing is extremely critical and time-consuming activity. It requires proper planning of the overall testing processes. Frequently the testing process start with a test plan that identifies all the testing related activities that must be performed and specifies the schedule allocates the resources and specifies guidelines for testing. The test plan specifies condition that should be tested, different units is to be tested, and the manner in which the modules will be integrated together. Then for different test units, a test case specification document is produces, which lists all the different test cases, together with expected outputs. During the testing of the unit, the specified test cases are executed and the actual result compared with the expected outputs. The final output of the testing phase is the test report and the error report, or a set of reports. Each test reports contain the set of test cases and the result of executing the code with these test cases. The errors report describes the error encountered and the action taken to remove the errors. 7.1.1 Unit testing: -

51

Unit testing deals with testing a unit as a whole. This would test the interaction of many functions but confine the test within one unit. The exact scope of a unit is left to interpretation. Supporting test code, sometimes called scaffolding, may be necessary to support an individual test. The architecture and implementation teams drive this type of testing. This focus is also called black box testing because only the details of the interface are visible to test. Limits that are global to a unit are tested here. In the construction industry scaffolding is a temporary, easy to assemble and disassemble, frame placed around a building to facilitate the construction of the building. The construction workers first build the scaffolding and then the building. Later the scaffolding is removed, exposing the completed building.

7.1.2 System testing: System testing has flow of data through entire system. Data flows from and between tables were checked. The entire system was checked with test data. The authentication and security problems were also tested, the system was found effective after test data, which was prepared for testing. 7.1.3 Testing Strategies: A testing is general approach for the testing process rather than a method of devising particular system or component test. There are various testing strategies such as Top down testing Bottom up testing Thread Testing Stress Testing . In general many systems are usually tested using mixture if testing strategies rather than any single approach. In top down testing program is represented as a single abstract component with such components in the top down testing are soon 52

as it is coded. By using this technique unnoticed designed errors are detected at any early stage in testing process. As those errors are usually structured early detecting means that they are corrected without incurring undue costs. Early detecting means that extensive re design and re implementation can be avoided. Another advantage that top down testing offers is that a limited working system is available at an early stage in development. It also demonstrates the feasibility of management. Bottom up testing involves testing modules is testing modules at lower levels in hierarchy of modules until the final module is tested. Bottom-up testing of critical low level system. Components are almost always necessary. Also in bottom up testing approach the objects are tested and once they are integrated into system, collections of objects are put to test once again. 7.2 IMPLEMENTATION: Conversion is the process of changing from the old system to new one. It must be properly planned and executed. Four methods are common in use. They are parallel system, direct conversion, pilot system and system phase-in. Each method should be considered in the light of the opportunities that it offers and problems that it may create. However, it may be possible that sometimes, we are forced to apply one methods may be more beneficial. In general system conversion should be accomplished in shortest possible time. Long conversions periods create problems for all persons involved including both analyst and users.

7.2.1 PARALLEL SYSTEM: The most secure method of converting from an old system to new system is to run both in parallel. Under this approach, users continue to operate the old system in usual manner but they also start using the new system. This method is safest one because it ensures that in case of any problems in using the new system, the organization still fall back to the old system without loss of time money. 53

The disadvantages of the parallel system approach are: It doubles operating cost. The new system may not get fair trial.

7.2.2 DIRECT CONVERSION: This method converts from the old to the new system abruptly, sometimes over a weekend. The old system is used until a planned conversion day, when it is replaced by the new system. There are no parallel activities. The organization relies fully on the system. The main disadvantages of this approach are: no other system to fall back on, if difficulties arise with new system. Secondly wise and carefully planning is required.

7.2.3 PILOT SYSTEM: This approach is often preferred in the case of the new system, which involves new techniques or some drastic changes in organization performance. In this method a working version of the system is implemented in one part of organization, such as a single work area of department. The users in this area are aware that they are piloting a new system and that changes are made and the system is installed in the remaining departments of the organization, either all at once direct method. This approach provides experience and live test before implementation.

7.2.4 PHASE IN METHOD: This method is used when it is not possible to install a new system throughout an organization at once. The conversion of files, training of personnel or arrival of equipment may force the staging of implementation over a period of

54

times, raging from weeks to months. It allows some users of new system early. Also it allows tanning and installation without unnecessary use of resources.

CODING

//********************** // HEADER FILES INCLUDED //********************** #include <conio.h> #include <string.h> #include <fstream.h> 55

#include <process.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <dos.h> //************************************ // THIS CLASS CONTROLLS ALL THE MENU'S //************************************ class menu { public : void main_menu(void) ; void room_menu(void) ; void customer_menu(void) ; }; //******************************************************* // THIS CLASS CONTROLLS ALL THE FUNCTIONS RELATED TO ROOM //******************************************************* class room { public : void add_room (void) ; void display_room(void) ; void rooms_list(void) ; void modify_room(void) ; void delete_room(void) ; int room_found( int ) ; 56

float room_getinfo(int) ; private : int recordno(int) ; void display_record(int) ; int room_no ; char room_type[5] ; float room_rent ; }; //*********************************************************** // THIS CLASS CONTROLLS ALL THE FUNCTIONS RELATED TO CUSTOMER //*********************************************************** class customer { public : void customer_checkin (void) ; void customer_checkout (void) ; void display_customers(void) ; void customers_list(void) ; void modify_customer(void) ; void delete_customer(void) ; private : int recordno(int) ; int d1 , m1 , y1; void display_record(int) ; void delete_record(int) ; int room_no , cguest ; char cname[21] , cphone[10] ,caddress[50] , carrived[20] ; char cnationality[20] ; 57

float downpayment , misc , room_service ; }; //**************************************************************** * // THIS CLASS CONTROLLS THE FUNCTION RELATED TO PREPARATION OF BILL //**************************************************************** * class account { public : void bill(int, float, char t_cname[21], float, float, float) ; }; //************************************* // MAIN_MENU FUNCTION OF THE MENU CLASS //************************************* void menu :: main_menu(void) { char ch ; while(1) { clrscr(); gotoxy(30,5) ; cout <<"HOTEL MANAGEMENT" ; gotoxy(30,7) ; cout <<"1. ROOM OPERATION "; gotoxy(30,8) ; 58

cout <<"2. CUSTOMER OPERATION "; gotoxy(30,9) ; cout <<"0. EXIT" ; gotoxy(30,13) ; cout <<"Enter your choice : " ; ch = getch() ; if ( ch == '1' ) { menu m ; m.room_menu() ; } else if ( ch == '2' ) { menu m ; m.customer_menu() ; } else if ( ch =='0' ) break ; }//END OF WHILE }//END OF MAIN_MENU //********************************* // ROOM_MENU FUNCTION OF MENU CLASS //********************************* void menu :: room_menu(void) { char ch ; while(1) 59

{ clrscr() ; gotoxy(30,6) ; cout <<" ROOM MENU " ; gotoxy(30,8) ; cout <<"1. ADD ROOM RECORDS" ; gotoxy(30,9) ; cout <<"2. DISPLAY ROOM RECORDS" ; gotoxy(30,10) ; cout <<"3. LIST OF ROOMS" ; gotoxy(30,11) ; cout <<"4. MODIFY ROOM RECORD" ; gotoxy(30,12) ; cout <<"5. DELETE ROOM RECORD" ; gotoxy(30,13) ; cout <<"0. EXIT" ; gotoxy(30,17) ; cout <<"Enter your choice : " ; ch = getch() ; if ( ch == '1' ) { room r ; r.add_room() ; } else if ( ch == '2' ) { room r ; r.display_room() ; } else 60

if ( ch == '3' ) { room r ; r. rooms_list() ; } else if ( ch == '4' ) { room r ; r.modify_room() ; } else if ( ch == '5' ) { room r ; r.delete_room() ; } else if ( ch == '0' ) break ; }//END OF WHILE }//END OF ROOM_EDIT_MENU //************************************* // CUSTOMER_MENU FUNCTION OF MENU CLASS //************************************* void menu :: customer_menu(void) { char ch ; while(1) 61

{ clrscr() ; gotoxy(30,6) ; cout <<"CUSTOMER MENU" ; gotoxy(30,8) ; cout <<"1. CHECK IN" ; gotoxy(30,9) ; cout <<"2. CHECK OUT" ; gotoxy(30,10) ; cout <<"3. DISPLAY CUSTOMER RECORDS" ; gotoxy(30,11) ; cout <<"4. LIST OF CUSTOMERS" ; gotoxy(30,12) ; cout <<"5. MODIFY CUSTOMER RECORD" ; gotoxy(30,13) ; cout <<"6. DELETE CUSTOMER RECORD" ; gotoxy(30,14) ; cout <<"0. EXIT" ; gotoxy(30,18) ; cout <<"Enter your choice : " ; ch = getch() ; if ( ch == '1' ) { customer c ; c.customer_checkin() ; } else if ( ch == '2' ) { customer c ; c.customer_checkout() ; 62

} else if ( ch == '3' ) { customer c ; c.display_customers() ; } else if ( ch == '4' ) { customer c ; c.customers_list() ; } else if ( ch == '5' ) { customer c ; c.modify_customer() ; } else if ( ch == '6' ) { customer c ; c.delete_customer() ; } else if ( ch == '0' ) break ; }//END OF WHILE }//END OF CUSTOMER_EDIT_MENU

63

//***BEGINING OF ROOM RELATED FUNCTIONS *** //******************************************************** // ADD_ROOM FUNCTION OF ROOM CLASS TO ADDS THE ROOM RECORD // TO THE ROOM FILE (ROOM.TXT). //******************************************************** void room :: add_room (void) { char ch ; char t_room_type[5] ; int t_room_no ; float t_room_rent ; do { fstream file ; file.open("ROOM.TXT", ios::out | ios::app ) ; clrscr() ; gotoxy(1,1) ; cout <<"Enter the details for the room" ; gotoxy(1,3) ; cout <<"Type gotoxy(1,4) ; cout <<"Room no. : " ; gotoxy(1,5) ; cout <<"Tarriff : " ; gotoxy(20,11) ; cout <<"SS : SINGLE SUIT" ; gotoxy(20,12) ; cout <<"SR : SINGLE ROOM" ; 64 : ";

gotoxy(20,13) ; cout <<"DR : DOUBLE ROOM" ; gotoxy(20,14) ; cout <<"DS : DOUBLE SUIT" ; int valid = 0 ; do { valid = 1 ; gotoxy(1,25) ; cout <<"ENTER THE ROOM TYPE (SS/SR/DR/DS)" ; gotoxy(13,3) ; cin >>t_room_type ; strupr(t_room_type) ; char *string[4] = {"SS","DR","SR","DS"} ; int result , count = 0 ; for ( int i=0; i<4; i++ ) { result = strcmpi(t_room_type,string[i]) ; if ( result != 0 ) count++ ; }//END OF FOR if ( count == 4 ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"INVALID CODE" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; 65

gotoxy(1,25) ; clreol() ; gotoxy(13,3) ; clreol() ; }//END OF IF } while ( valid == 0 ) ;//END OF DO for ( int i=11; i<=14; i++ ) { gotoxy(1,i) ; clreol() ; }//END OF FOR do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ROOM NUMBER" ; gotoxy(13,4) ; cin >>t_room_no ; if ( t_room_no <= 0 || t_room_no > 900 ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"IT SHOULD NOT BE NEGATIVE OR ZERO OR"; cout<<" GREATER THAN 900" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(13,4) ; clreol() ; }//END OF IF 66

if ( room_found( t_room_no ) ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. ALREADY EXIST" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(13,4) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE RENT OF THE ROOM" ; gotoxy(13,5) ; cin >>t_room_rent ; if ( t_room_rent <= 0 ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"IT SHOULD NOT BE NEGATIVE OR ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; 67

getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(13,6) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO gotoxy(1,8) ; cout <<"Do you want to save the record (y/n) : " ; do { valid = 1 ; gotoxy(42,8) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,8) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'Y') { strcpy(room_type,t_room_type) ; room_no = t_room_no ; room_rent = t_room_rent ; file.write((char *) this, sizeof(room)) ; }//END OF IF gotoxy(1,9) ; cout <<"Do you want to add more records (y/n) : " ; do { 68

valid = 1 ; gotoxy(42,9) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,9) ; clreol() ; }//END OF IF } while(!valid);//END OF DO file.close () ; } while ( ch == 'Y') ;//END OF DO }//END OF ADD //***************************************************** // DISPLAY_ROOM FUNCTION OF ROOM CLASS TO GIVE ROOM NO. // TO DISPLAY THE ROOM RECORD. //***************************************************** void room :: display_room(void) { clrscr() ; int t_room_no ; gotoxy(1,3) ; cout <<"Enter the Room no. : " ; cin >>t_room_no ; if (!room_found(t_room_no)) { gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. NOT FOUND" ; 69

gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; return ; } clrscr() ; gotoxy(5,3) ; cout <<"ROOM RECORD" ; display_record(t_room_no) ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getch() ; }//END OF DISPLAY_ROOM_RECORD //******************************************************** // ROOMS_LIST FUNCTION OF ROOM CLASS TO SHOW LIST OF ROOMS //******************************************************** void room :: rooms_list (void) { clrscr() ; fstream file ; file.open("ROOM.TXT", ios::in) ; file.seekg(0) ; int row = 5 , found = 0 , pageno = 1 ; gotoxy(18,1) ; cout <<"LIST OF ROOMS" ; gotoxy(1,3) ; cout <<" Room Type { 70 Room no. Rent"; while (file.read((char *) this, sizeof(room)))

found = 1 ; gotoxy(2,row) ; cout <<room_type ; gotoxy(16,row) ; cout <<room_no ; gotoxy(29,row) ; cout <<room_rent ; if ( row == 23 ) { row = 5 ; gotoxy(66,1) ; cout <<"Page no. : " <<pageno ; pageno++ ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; clrscr() ; gotoxy(18,1) ; cout <<"LIST OF ROOMS" ; gotoxy(1,3) ; cout <<" Room Type } else row++ ; }//END OF WHILE if ( !found ) { gotoxy(1,5) ; cout <<"Records not found" ; } gotoxy(66,1) ; 71 Room no. Rent";

cout <<"Page no. : " <<pageno ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; file.close () ; }//END OF DISPLAY LIST //************************************************************* // MODIFY_ROOM FUNCTION OF ROOM CLASS TO MODIFY THE ROOM RECORD // IN THE ROOM FILE (ROOM.TXT). //************************************************************* void room :: modify_room(void) { clrscr() ; int valid ; char ch ; char t_room_type[5] ; int t_room_no , tr ; float t_room_rent ; fstream file ; file.open("ROOM.TXT", ios::out | ios::ate) ; gotoxy(1,3) ; cout <<"Enter the Room no. to be modified " ; cin >>tr ; if ( !room_found( tr ) ) { gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. NOT FOUND" ; 72

gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; return ; }//END OF IF display_record(tr) ; gotoxy(1,10) ; cout <<"Do you want to modify this Room Record (y/n) : " ; do { valid = 1 ; gotoxy(48,10) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,9) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'N') return ; gotoxy(1,12) ; cout <<"ENTER THE NEW DATA FOR THE ROOM" ; gotoxy(1,14) ; cout <<"Type gotoxy(1,15) ; cout <<"Room no. : " ; gotoxy(1,16) ; cout <<"Rent do 73 : "; : ";

{ valid = 1 ; gotoxy(1,25) ; cout <<"ENTER THE ROOM TYPE (SS/SR/DR/DS)" ; gotoxy(13,14) ; cin >>t_room_type ; strupr(t_room_type) ; char *string[4] = {"SS","DR","SR","DS"} ; int result , count = 0 ; for ( int i=0; i<4; i++ ) { result = strcmpi(t_room_type,string[i]) ; if ( result != 0 ) count++ ; }//END OF FOR if ( count == 4 ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"INVALID CODE" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(13,14) ; clreol() ; }//END OF IF } while ( valid == 0 ) ;//END OF DO do { 74

valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ROOM NUMBER" ; gotoxy(13,15) ; cin >>t_room_no ; if ( t_room_no <= 0 || t_room_no > 900 ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO OR"; cout<<" GREATER THAN 900" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(13,15) ; clreol() ; }//END OF IF if ( room_found( t_room_no ) && t_room_no != tr ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. ALREADY EXIST" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; 75

gotoxy(1,25) ; clreol() ; gotoxy(13,15) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE TARRIFF FOR THE ROOM" ; gotoxy(13,17) ; cin >>t_room_rent ; if ( t_room_rent <= 0 ) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"IT SHOULD NOT BE NEGATIVE OR ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(13,17) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO gotoxy(1,19) ; cout <<"Do you want to save the record (y/n) : " ; do { valid = 1 ; 76

gotoxy(42,19) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,19) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'Y') { int recno ; recno = recordno(tr) ; int location ; location = (recno-1) * sizeof(room) ; file.seekp(location) ; strcpy(room_type,t_room_type) ; room_no = t_room_no ; room_rent = t_room_rent ; file.write((char *) this, sizeof(room)) ; }//END OF IF file.close () ; }//END OF MODIFY //************************************************************** // DELETE ROOM FUNCTION OF ROOM CLASS TO DELETES THE ROOM RECORD // IN THE ROOM FILE (ROOM.TXT). //************************************************************** void room :: delete_room(void) 77

{ clrscr() ; int valid ; char ch ; int t_room_no ; gotoxy(1,3) ; cout <<"Enter the Room No. to be deleted " ; cin >>t_room_no ; if ( !room_found( t_room_no ) ) { gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. NOT FOUND" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; return ; } display_record(t_room_no) ; gotoxy(1,10) ; cout <<"Do you want to delete this Room Record (y/n) : " ; do { valid = 1 ; gotoxy(48,10) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,9) ; clreol() ; 78

} } while ( !valid ) ;//END OF DO if (ch == 'N') return ; fstream file ; file.open("ROOM.TXT", ios::in) ; fstream temp ; temp.open("temp.txt", ios::out) ; while ( !file.eof() ) { file.read((char *) this, sizeof(room)) ; if ( file.eof() ) break ; if ( room_no != t_room_no ) temp.write((char *) this, sizeof(room)) ; }//END OF WHILE file.close() ; temp.close() ; file.open("ROOM.TXT", ios::out) ; temp.open("temp.txt", ios::in) ; temp.seekg(0) ; while ( !temp.eof() ) { temp.read((char *) this, sizeof(room)) ; if ( temp.eof() ) break ; file.write((char *) this, sizeof(room)) ; }//END OF WHILE file.close() ; temp.close() ; }//END OF DELETION 79

//********************************** // ROOM_FOUND FUNCTION OF ROOM CLASS //********************************** int room :: room_found ( int t_room_no ) { fstream file ; file.open("ROOM.TXT", ios::in) ; file.seekg(0) ; int found = 0 ; while (file.read((char *) this, sizeof(room))) { if ( room_no == t_room_no ) found = 1 ; } file.close() ; return found ; }//END OF ROOM_FOUND //*************************************************** // ROOM_GETINFO FUNCTION OF ROOM CLASS TO RETURNS THE // TARRIFF OF THE GIVEN ROOM NO. //*************************************************** float room :: room_getinfo(int t_room_no) { fstream file ; file.open("ROOM.TXT", ios::in) ; file.seekg(0) ; float t_room_rent ; 80

while (file.read((char *) this, sizeof(room))) { if (t_room_no == room_no) { t_room_rent = room_rent ; break ; }//END OF IF }//END OF WHILE file.close() ; return t_room_rent ; }//END OF ROOM_GETINFO

//********************************************************** // RECORDNO FUNCTION OF ROOM CLASS TO RETURNS THE RECORD NO. // OF THE GIVEN ROOM NO. //********************************************************** int room :: recordno(int t_room_no) { fstream file ; file.open("ROOM.TXT", ios::in) ; file.seekg(0) ; int count = 0 ; while (file.read((char *) this, sizeof(room))) { count++ ; if (t_room_no == room_no) break ; } 81

file.close() ; return count ; }//END OF RECORDNO //***************************************************** // DISPLAY_RECORD FUNCTON OF ROOM CLASS TO DISPLAYS THE // RECORD OF THE GIVEN ROOM NO. //***************************************************** void room :: display_record(int t_room_no) { fstream file ; file.open("ROOM.TXT", ios::in) ; file.seekg(0) ; int found = 0 ; while (file.read((char *) this, sizeof(room)) && !found) { if (t_room_no == room_no) { found = 1 ; gotoxy(1,5) ; cout <<"Room Type : " <<room_type ; gotoxy(1,6) ; cout <<"Room no. : " <<room_no ; gotoxy(1,7) ; cout <<"Room Rent : " <<room_rent ; }//END OF IF }//END OF WHILE file.close () ; }//END OF DISPLAY_RECORD

82

//***END OF ROOM RELATED FUNCTIONS *** //***BEGINING OF CUSTOMER RELATED FUNCTIONS ***

//******************************************************* // CUSTOMER_CHECKIN FUNCTION OF CUSTOMER CLASS TO ADD THE // RECORDS IN THE CUSTOMER FILE (CUSTOMER.TXT) //******************************************************* void customer :: customer_checkin(void) { room r ; char ch ; int valid = 1 ; int t_room_no , t_cguest ; char t_day[3], t_month[3], t_year[5] ; char t_cname[25] , t_caddress[50] , t_cphone[15] , t_carrived[20] ; char t_cnationality[20] ; float t_downpayment , t_misc , t_room_service ; t_downpayment = t_misc = t_room_service = 0 ; clrscr() ; gotoxy(1,2) ; cout <<"Date : " ; gotoxy(1,4) ; cout <<"Enter the details of the Customer" ; gotoxy(1,5) ; cout <<"Room no. gotoxy(1,6) ; cout <<"Name :"; 83 :";

gotoxy(1,7) ; cout <<"No. of guests gotoxy(1,8) ; cout <<"Address gotoxy(1,9) ; cout <<"Phone gotoxy(1,10) ; cout <<"Nationality gotoxy(1,11) ; cout <<"Arriving From gotoxy(1,14) ; cout <<"Advance gotoxy(1,15) ; cout <<"Miscellineous gotoxy(1,16) ; cout <<"Room service int t_d1, t_m1, t_y1 ; struct date d; getdate(&d); // to accept system date t_d1 = d.da_day ; t_m1 = d.da_mon ; t_y1 = d.da_year ; gotoxy(8,2) ; cout <<t_d1 <<"/" <<t_m1 <<"/" <<t_y1 ; //=========================== gotoxy(20,5) ; cin >>t_room_no ; //Accepting The Room No. do { 84 :"; //ACCEPTING SYSTEM DATE :"; :"; :"; :"; :"; :"; :";

valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE NAME OF THE CUSTOMER" ; gotoxy(20,6) ; gets(t_cname) ; strupr(t_cname) ; fflush(stdin) ; if ((strlen(t_cname) <= 0) || (strlen(t_cname) > 25)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 25" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,6) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE NO. OF GUESTS WITH THE CUSTOMER" ; gotoxy(20,7) ; 85

cin >>t_cguest ; if ((t_cguest < 0) || (t_cguest > 1000)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"GUESTS SHOULD NOT BE LESS THAN 0 OR GREATER THAN 1000" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,7) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ADDRESS OF THE CUSTOMER" ; gotoxy(20,8) ; gets(t_caddress) ; fflush(stdin) ; if ((strlen(t_caddress) <= 0) || (strlen(t_caddress) > 50)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ;

86

cout <<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 50" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,8) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE PHONE NO. OF THE CUSTOMER, ENTER '-' FOR NO PHONE NO." ; gotoxy(20,9) ; cin >>t_cphone ; if ((strlen(t_cphone) < 7 && strlen(t_cphone) > 1) || (strlen(t_cphone) > 15)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT LESS THAN 7 OR GREATER THAN 15" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; 87

gotoxy(1,25) ; clreol() ; gotoxy(20,9) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER NATIONALITY OF THE CUSTOMER" ; gotoxy(20,10) ; gets(t_cnationality) ; fflush(stdin) ; if ((strlen(t_cnationality) <= 0) || (strlen(t_cnationality) > 20)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER THAN 20" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,10) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; 88

gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER DESTINATION FROM WHERE THE CUSTOMER HAS ARRIVED" ; gotoxy(20,11) ; gets(t_carrived) ; fflush(stdin) ; if ((strlen(t_carrived) <= 0) || (strlen(t_carrived) > 20)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER THAN 20" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,11) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ADVANCE PAYMENT IN RS.(IF ANY)" ; gotoxy(20,14) ; cin >>t_downpayment ; 89

if (t_downpayment < 0) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"SHOULD NOT LESS THAN ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,14) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF WHILE do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE MISCALLENIOUS CHARGES (IF ANY)" ; gotoxy(20,15) ; cin >>t_misc ; if (t_misc < 0) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"SHOULD NOT LESS THAN ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; 90

getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,15) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF WHILE do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ROOM SERVICE CHARGES (IF ANY)" ; gotoxy(20,16) ; cin >>t_room_service ; if (t_room_service < 0) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"SHOULD NOT LESS THAN ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,16) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO gotoxy(1,20) ; cout <<"Do you want to save the record (y/n) : " ; do 91

{ valid = 1 ; gotoxy(42,19) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,19) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'Y') { d1 = t_d1 ; m1 = t_m1 ; y1 = t_y1 ; room_no = t_room_no ; strcpy(cname,t_cname) ; cguest = t_cguest ; strcpy(caddress,t_caddress) ; strcpy(cphone,t_cphone) ; strcpy(cnationality,t_cnationality) ; strcpy(carrived,t_carrived) ; downpayment = t_downpayment ; misc = t_misc ; room_service = t_room_service ; fstream file ; file.open("CUSTOMER.TXT", ios::out | ios::app) ; file.write((char*) this, sizeof(customer)) ; file.close() ; }//END OF IF 92

}//END OF CHECK_IN //******************************************************** // CUSTOMER_CHECKOUT FUNCTION OF CUSTOMER CLASS TO GIVE THE // DATA OF THE CUSTOMER TO PREPARE BILL OF THE CUSTOMER AND // ALSO DELETE THE CUSTOMER'S RECORD //******************************************************** void customer :: customer_checkout(void) { clrscr() ; room r ; int valid ; char ch ; int t_room_no ; gotoxy(1,3) ; cout <<"Enter the Room no. of the customer to be check out " ; cin >>t_room_no ; if (!r.room_found(t_room_no)) { gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. NOT FOUND OR ROOM IS VACANT" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; return ; }//END OF IF display_record(t_room_no) ; 93

gotoxy(1,25) ; cout <<"Do you want to prepare bill of this Customer Record (y/n) : " ; do { valid = 1 ; gotoxy(63,24) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(63,24) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'N') return ; fstream file ; file.open("CUSTOMER.TXT", ios::in) ; file.seekg(0) ; char t_cname[21] ; float t_downpayment, t_room_service, t_misc, t_room_rent ; while (file.read((char *) this, sizeof(customer))) { if (t_room_no == room_no) { strcpy(t_cname,cname) ; t_downpayment = downpayment ; t_room_service = room_service ; t_misc = misc ; break ; }//END OF IF 94

}//END OF WHILE file.close() ; t_room_rent = r.room_getinfo(t_room_no) ; account a ; a.bill(t_room_no,t_room_rent,t_cname,t_downpayment,t_room_service,t_misc) ; delete_record(t_room_no) ; gotoxy(1,27) ; cout <<"Press any key to continue..." ; getche() ; }//END OF CHECKOUT //********************************************************** // DISPLAY_CUSTOMERS FUNCTION OF CUSTOMER CLASS TO GIVES THE // ROOM NO.OF THE CUSTOMER TO DISPLAY THE CUSTOMER RECORD //********************************************************** void customer :: display_customers(void) { clrscr() ; room r ; int valid ; int t_room_no ; gotoxy(1,3) ; cout <<"Enter the Room no. of the customer : " ; cin >>t_room_no ; if (!r.room_found(t_room_no) ) { gotoxy(1,25) ; clreol() ; 95

gotoxy(1,24) ; cout <<"ROOM NO. NOT FOUND OR ROOM IS VACANT" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; return ; }//END OF IF clrscr() ; gotoxy(5,3) ; cout <<"CUSTOMER RECORD" ; display_record(t_room_no) ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getch() ; }//END OF DISPLAY_CUSTOMER_RECORD //********************************************************** // CUSTOMERS_LIST FUNCTION OF CUSTOMER CLASS TO DISPLAYS THE // LIST OF THE CUSTOMER RECORDS //********************************************************** void customer :: customers_list(void) { clrscr() ; fstream file ; file.open("CUSTOMER.TXT", ios::in) ; file.seekg(0) ; int row = 5 , found = 0 , pageno = 1 , total = 0 ; gotoxy(18,1) ; cout <<"LIST OF CUSTOMERS" ; 96

gotoxy(1,3) ; cout <<" Room No. Date cout<<"Room service { total++ ; found = 1 ; gotoxy(2,row) ; cout <<room_no ; gotoxy(8,row) ; cout << d1 << "/" << m1 << "/" << y1 ; gotoxy(19,row) ; puts(cname) ; fflush(stdout) ; gotoxy(48,row) ; cout <<room_service ; gotoxy(63,row) ; cout <<downpayment ; gotoxy(74,row) ; cout <<misc ; if ( row == 23 ) { row = 5 ; gotoxy(66,1) ; cout <<"Page no. : " <<pageno ; pageno++ ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; clrscr() ; gotoxy(18,1) ; 97 Name Misc." ; "; Advance

while (file.read((char *) this, sizeof(customer)))

cout <<"LIST OF CUSTOMERS" ; gotoxy(1,3) ; cout<<" Room no. Name }//END OF IF else row++ ; }//END OF WHILE if ( !found ) { gotoxy(1,5) ; cout <<"Records not found" ; } gotoxy(66,1) ; cout <<"Page no. : " <<pageno ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; clrscr() ; gotoxy(5,5) ; cout <<"Total no. of Customers = " <<total ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; file.close () ; }//END OF DISPLAY_LIST //********************************************************* // MODIFY_CUSTOMER FUNCTION OF CUSTOMER CLASS TO MODIFY THE // CUSTOMER RECORD IN THE CUSTOMER'S FILE (CUSTOMER.TXT) 98 Phone "; cout<<" Room service Advance Misc." ;

//********************************************************* void customer :: modify_customer(void) { clrscr() ; room r ; int valid ; char ch ; int t_room_no ,tr, t_cguest ; char t_cname[25] , t_caddress[50] , t_cphone[15] , t_carrived[20] ; char t_cnationality[20] ; float t_downpayment , t_misc , t_room_service ; fstream file ; file.open("CUSTOMER.TXT", ios::out | ios::ate) ; gotoxy(1,3) ; cout <<"Enter the Room no. of the customer to be modified " ; cin >>tr ; display_record(tr) ; gotoxy(1,18) ; cout <<"Do you want to modify this Room Record (y/n) : " ; do { valid = 1 ; gotoxy(48,12) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,12) ; clreol() ; } 99

} while ( !valid ) ;//END OF WHILE if (ch == 'N') return ; clrscr() ; //ACCEPTING SYSTEM DATE gotoxy(1,3) ; cout <<"Date : " ; int t_d1, t_m1, t_y1 ; struct date d; getdate(&d); // to accept system date t_d1 = d.da_day ; t_m1 = d.da_mon ; t_y1 = d.da_year ; gotoxy(8,3) ; cout << t_d1 <<"/" <<t_m1 <<"/" <<t_y1 ; //=========================== cout <<"ENTER THE NEW DATA FOR THE CUSTOMER" ; gotoxy(1,6) ; cout <<"Room no. gotoxy(1,7) ; cout <<"Name gotoxy(1,8) ; cout <<"No. of guests gotoxy(1,9) ; cout <<"Address gotoxy(1,10) ; cout <<"Phone gotoxy(1,11) ; cout <<"Nationality gotoxy(1,12) ; 100 :"; :"; :"; :"; :"; :";

cout <<"Arriving From gotoxy(1,13) ; cout <<"Advance gotoxy(1,14) ; cout <<"Miscellineous gotoxy(1,15) ; cout <<"Room service gotoxy(20,3) ; do { valid = 1 ;

:"; :"; :"; :";

gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ROOM NUMBER FOR CUSTOMER" ; gotoxy(20,6) ; cin >>t_room_no ; if ((!r.room_found(t_room_no)) || (r.room_found(t_room_no) && t_room_no != tr )) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. NOT EXIST OR NOT VACANT" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,6) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO 101

do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE NAME OF THE CUSTOMER" ; gotoxy(20,7) ; gets(t_cname) ; strupr(t_cname) ; fflush(stdin) ; if ((strlen(t_cname) <= 0) || (strlen(t_cname) > 25)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 25" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,7) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ;

102

cout <<"ENTER THE NO. OF GUESTS WITH THE CUSTOMER" ; gotoxy(20,8) ; cin >>t_cguest ; if ((t_cguest < 0) || (t_cguest > 1000)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"GUESTS SHOULD NOT BE LESS THAN 0 OR GREATER THAN 1000" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,8) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ADDRESS OF THE CUSTOMER" ; gotoxy(20,9) ; gets(t_caddress) ; fflush(stdin) ; if ((strlen(t_caddress) <= 0) || (strlen(t_caddress) > 50)) { valid = 0 ; 103

gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 50" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,9) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE PHONE NO. OF THE CUSTOMER, ENTER '-' FOR NO PHONE NO." ; gotoxy(20,10) ; cin >>t_cphone ; if ((strlen(t_cphone) < 7 && strlen(t_cphone) > 1) || (strlen(t_cphone) > 15)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT LESS THAN 7 OR GREATER THAN 15" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; 104

getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,10) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER NATIONALITY OF THE CUSTOMER" ; gotoxy(20,11) ; gets(t_cnationality) ; fflush(stdin) ; if ((strlen(t_cnationality) <= 0) || (strlen(t_cnationality) > 20)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER THAN 20" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,11) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do 105

{ valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER DESTINATION FROM WHERE THE CUSTOMER HAS ARRIVED" ; gotoxy(20,12) ; gets(t_carrived) ; fflush(stdin) ; if ((strlen(t_carrived) <= 0) || (strlen(t_carrived) > 20)) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER THAN 20" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,12) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ADVANCE PAYMENT IN RS.(IF ANY)" ; 106

gotoxy(20,11) ; cin >>t_downpayment ; if (t_downpayment < 0) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"SHOULD NOT LESS THAN ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,11) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF WHILE do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE MISCALLENIOUS CHARGES (IF ANY)" ; gotoxy(20,12) ; cin >>t_misc ; if (t_misc < 0) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"SHOULD NOT LESS THAN ZERO" ; 107

gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,12) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF WHILE do { valid = 1 ; gotoxy(1,25) ; clreol() ; gotoxy(1,25) ; cout <<"ENTER THE ROOM SERVICE CHARGES (IF ANY)" ; gotoxy(20,13) ; cin >>t_room_service ; if (t_room_service < 0) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"SHOULD NOT LESS THAN ZERO" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; getche() ; gotoxy(1,24) ; clreol() ; gotoxy(1,25) ; clreol() ; gotoxy(20,13) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO gotoxy(1,15) ; 108

cout <<"Do you want to save the record (y/n) : " ; do { valid = 1 ; gotoxy(42,15) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(42,15) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'Y') { if (t_room_no != tr) { } int recno ; recno = recordno(tr) ; int location ; location = (recno-1) * sizeof(customer) ; file.seekp(location) ; d1 = t_d1 ; m1 = t_m1 ; y1 = t_y1 ; room_no = t_room_no ; strcpy(cname,t_cname) ; strcpy(cphone,t_cphone) ; strcpy(caddress,t_caddress) ; downpayment = t_downpayment ; 109

misc = t_misc ; room_service = t_room_service ; fstream file ; file.open("CUSTOMER.TXT", ios::out | ios::app) ; file.write((char*) this, sizeof(customer)) ; }//END OF IF file.close () ; }//END OF MODIFY //******************************************************* // DELETE CUSTOMER FUNCTION OF CUSTOMER CLASS TO GIVE THE // ROOM NO OF THE CUSTOMER TO DELETE THE CUSTOMER RECORD //******************************************************* void customer :: delete_customer(void) { clrscr() ; room r ; int valid ; char ch ; int t_room_no ; gotoxy(1,3) ; cout <<"Enter the Room no. of the customer to be deleted " ; cin >>t_room_no ; if (!r.room_found(t_room_no) ) { gotoxy(1,25) ; clreol() ; gotoxy(1,24) ; cout <<"ROOM NO. NOT FOUND OR ROOM IS VACANT" ; gotoxy(1,25) ; cout <<"Press any key to continue..." ; 110

getche() ; return ; }//END OF IF display_record(t_room_no) ; gotoxy(1,15) ; cout <<"Do you want to delete this Customer Record (y/n) : " ; do { valid = 1 ; gotoxy(52,15) ; ch = getche() ; ch = toupper(ch) ; if (ch != 'Y' && ch != 'N') { valid = 0 ; gotoxy(52,15) ; clreol() ; } } while ( !valid ) ;//END OF DO if (ch == 'N') return ; delete_record(t_room_no) ; }//END OF DELETION //************************************************************ // RECORDNO FUNCTION OF CUSTOMER CLASS TO RETURN THE RECORD NO. // OF THE GIVEN ROOM NO. IN CUSTOMER'S FILE //************************************************************ int customer :: recordno(int t_room_no) { 111

fstream file ; file.open("CUSTOMER.TXT", ios::in) ; file.seekg(0) ; int count = 0 ; while (file.read((char *) this, sizeof(customer))) { count++ ; if (t_room_no == room_no) break ; }//END OF WHILE file.close() ; return count ; }//END OF RECORDNO //********************************************************* // DISPLAY_RECORD FUNCTION OF CUSTOMER CLASS TO DISPLAY THE // RECORDS OF CUSTOMER IN THE GIVEN ROOM NO. //********************************************************* void customer :: display_record(int t_room_no) { fstream file ; file.open("CUSTOMER.TXT", ios::in) ; file.seekg(0) ; int found = 0 ; while (file.read((char *) this, sizeof(customer)) && !found) { if (t_room_no == room_no) { found = 1 ; 112

gotoxy(1,4) ; cout <<"Date : " << d1 <<"/" << m1 <<"/"<< y1 ; gotoxy(1,5) ; cout <<"Room no. gotoxy(1,6) ; cout <<"Name gotoxy(1,7) ; cout <<"No. of guests gotoxy(1,8) ; cout <<"Address gotoxy(1,9) ; cout <<"Phone gotoxy(1,11) ; cout <<"Nationality gotoxy(1,12) ; cout <<"Arriving From gotoxy(1,14) ; cout <<"Downpayment gotoxy(1,15) ; cout <<"Miscellineous gotoxy(1,16) ; cout <<"Room service }//END OF IF }//END OF WHILE file.close () ; }//END OF DISPLAY_RECORD //******************************************************** // DELETE_RECORD FUNCTION OF CUSTOMER CLASS TO DELETE THE // CUSTOMER'S RECORD IN THE CUSTOMER'S FILE (CUSTOMER.TXT) // OF THE GIVEN ROOM NO. 113 : " << room_service ; : " << misc ; : " << downpayment ; : " << carrived ; : " << cnationality ; : " << cphone; : " << caddress ; : " << cguest ; : " << cname ; : " << room_no ;

//******************************************************** void customer :: delete_record(int t_room_no) { fstream file ; file.open("CUSTOMER.TXT", ios::in) ; fstream temp ; temp.open("temp.txt", ios::out) ; while ( !file.eof() ) { file.read((char *) this, sizeof(customer)) ; if ( file.eof() ) break ; if ( room_no != t_room_no ) temp.write((char *) this, sizeof(customer)) ; }//END OF WHILE file.close() ; temp.close() ; file.open("CUSTOMER.TXT", ios::out) ; temp.open("temp.txt", ios::in) ; temp.seekg(0) ; while ( !temp.eof() ) { temp.read((char *) this, sizeof(customer)) ; if ( temp.eof() ) break ; file.write((char *) this, sizeof(customer)) ; }//END OF WHILE file.close() ; temp.close() ; }//END OF DELETE_RECORD 114

//***END OF CUSTOMER RELATED FUNCTIONS*** //***BEGINING OF BILL RELATED FUNCTION*** //********************************************************* // BILL FUNCTION OF ACCOUNT CLASS TO ACCEPT THE DATA OF THE // CUSTOMER , PREPARE BILL & ALSO CREATES BILL SLIP //********************************************************* void account :: bill(int t_room_no, float t_room_rent, char t_cname[21], float t_downpayment, float t_room_service, float t_misc) { int valid ; int days ; float tax , total ; gotoxy(1,28) ; cout <<"Enter the no. of days : " ; do { valid = 1 ; gotoxy(25,28) ; cin >>days ; if (days < 0 || days > 999) { valid = 0 ; gotoxy(1,25) ; clreol() ; gotoxy(1,26) ; cout <<"SHOULD NOT LESS THAN ZERO" ; gotoxy(1,27) ; cout <<"Press any key to continue..." ; 115

getche() ; gotoxy(1,25) ; clreol() ; gotoxy(1,26) ; clreol() ; gotoxy(1,27) ; clreol() ; }//END OF IF } while ( !valid ) ;//END OF DO t_room_rent = t_room_rent * days ; total = (t_room_service + t_misc + t_room_rent) - t_downpayment ; tax = total * 0.05 ; total = total + tax ; clrscr() ; int t_d1, t_m1, t_y1 ; struct date d; getdate(&d); // to accept system date t_d1 = d.da_day ; t_m1 = d.da_mon ; t_y1 = d.da_year ; gotoxy(31,3) ; cout <<"Palace Hotel" ; gotoxy(60,5) ; cout <<"Date: " << t_d1 << "/" << t_m1 << "/" <<t_y1 ; menu m ; gotoxy(5,7) ; cout <<"Bill of Room no. : " <<t_room_no ; gotoxy(5,9) ; cout <<"Name of Customer gotoxy(5,11) ; cout <<"Tarriff Charges gotoxy(5,12) ; cout <<"Misc. Charges gotoxy(5,13) ; 116 : " <<t_misc ; : " <<t_room_rent ; : " <<t_cname ;

cout <<"Room service Charges : " <<t_room_service ; gotoxy(5,15) ; cout <<"Tax gotoxy(5,17) ; cout <<"Advance gotoxy(5,19) ; cout <<"------------------------------------------" ; gotoxy(5,20) ; cout <<"Total Bill gotoxy(5,21) ; cout <<"------------------------------------------" ; gotoxy(6,25) ; cout <<"CASHIER" ; }//END OF PREPARE_BILL : " <<total ; : " <<t_downpayment ; : " <<tax ;

//***END OF CUSTOMER RELATED FUNCTIONS*** //********************************************************** // MAIN FUNCTION CALLS THE MENU FUNCTION. //********************************************************** void main ( void ) { menu m ; m.main_menu() ; clrscr(); }//END OF MAIN

117

SCREENSHOT
LAYOUTS OF INPUT AND OUTPUT Screen layout: - Screen layout section describes the flow of all the Input and output window along with its layout and its functionality. These are the layouts if this entire project, which will help to know a bit more about this project. Through these layouts the process of learning will become easy and anyone can understand it in a better way.

118

A final step in system performance definition is describing the outputs required by the user. An actual sketch of the format and contents of the reports (layout) as well as a specification of the media used, their frequency, and the size and number of copies required are prepared at this point. Specifying exactly what the output will look like leads to an estimate of the computer storage requirements that form the basis for the file design to be undertaken in the design phase of the life cycle. The analyst is now ready to evaluate the feasibility of candidate systems to produce these outputs. (a) STARTING WITH THE PROJECT: After the successful installation of the TAJ HOTEL MANAGEMENT SYSTEM, the Menu window will appear on the screen, where the user can choose the following Operations.

(b). INTRODUCTION: Through option 1 add new taj Hotel Management System records

119

120

121

122

123

124

125

126

127

128

129

130

131

132

Documentation
Software documentation is the written record of facts about a software system encoded with the intent to convey purpose, content and clarity. The recording process usually begins when the need for the system is conceived and continues until the system is no longer in use. There are different categories of software documentation like user documentation, system documentation, etc. 9.1 User documentation: It refers to those documents, containing description of the function of a system without reference to how these functions are implemented.

Users Documentation S.No. Document 1 System overview 2 Installation guide Function Provide general description of system functions Describe how to setup the system, customize I to local hardware needs and configure it to particulars 3 4 5 6 7 Beginners guide Reference Guide Enhancement Quick reference card System administration hardware and other software system Provide simple explanations of how to start using the system. Provide in Depth description of each system facility and how it can be used. Booklet contains a summary of new features. Serves as the factual lookup. Provides information on services such as networking, security and upgrading.

133

9.2 System Documentation: -It refers to those documentations containing all facts of systems, including analysis, specifications, design, implementation, testing, security, error diagnosis and recovery. System Documentations S.No. 1 2 3 Document System Rationale SRS Specification/Design Function Describes the objective of the entire system. Provide information on exact requirement of system as agreed between user and developer. Provide description of: 4 Implementation How system requirements are implemented. How the system is decompose into a set of interacting program units. The function of each program unit. Provides descriptions of: How the detailed system design is expressed in some formal programming language. 5 System Test Plan Program actions in the form of intra program comments Provide description of how program units are tested individually and how the system is tested 6 7 Acceptance Test Plan Data Dictionaries after integration. Describe the tests that the system must pass before users accept it. Contains description of all terms that relate to the software in questions.

CONCLUSION
134

This project Hotel Management System deals with the Customer registration process, Edit, delete, and search process for Customer details and various other operations such as billing and so on. This project is successful in meeting the goals of this concern, where the manual system was out at their full satisfaction. By computerizing the concern, the accuracy of the data recording has been increased and the speed is also increased. This system provides precise enlistment of customer information. Its the customer details. It gives adequate information about the customer. Data can be retrieved as and when required. It creates different data and is stored in different File sections. These files are also used for further processes from time to time by the hotel management

135

SCOPE OF PROJECT
As we know this project is meant for the HOTELS and need sufficient funds to implement this project to their different sections and this system also need trained staff to use this system. And today these types of systems are implemented in almost all portions of the society. So about the scope of this project I want to say that this is a system of new era and everybody may use it. This project is managing the records of customers, their account bills, and various transactions as its main goal, once the system started working certain new things were found to be added into it, so some reports coming from the user department are manual and they should also be computerized. The system can also be made more user-friendly and interactive by overcoming the limitations and the user will find it more informative.

136

REFERENCES
E Balagurusamy, Object-Oriented Programming With C++, 2nd Edition Software Engineering-A Practitioners approach Roger S. Pressman Timothy Budd,An introduction to object oriented programming Pearson educations Asia, 2001 Software Engineering K.K. Aggarwal & Yogesh Singh (2nd Edition)

137

APPENDIX
Following are some header files used in this project: - <conio.h> <dos.h> <fstream.h> Declares various functions used in calling the dos console I/O routines. Defines various constants and gives declarations needed for DOS and 8086-specific calls. Declares the C++ stream classes that support file input and output. It contains function prototypes for functions that perform input from files on disk and output to files from disk. <iomanip.h> Declares the C++ streams I/O manipulators and contains macros for creating parameterized manipulators. It contains function prototypes for the stream manipulators that enable formatting of streams of data. <iostream.h> Declares the basic C++ (version 2.0) streams (I/O) routines. It contains function prototypes for the standard input and standard output functions. <process.h> <stdio.h> It contains function declarations and macros used in working with threads and processes. Defines types and macros needed for the standard I/O package defined in Kernighan and Ritchie and extended under UNIX system V. define the standard I/O predefined streams stdin, stout, stdprn, and stderr, and declares streamlevel I/O routines. It contains function prototypes for the standard I/O library functions and information used by them. <stdlib.h> Contains function prototypes for conversion of numbers to text, text to numbers, memory allocation, random numbers, and various other utility functions.

138

Some Keywords used in this project with their meaning are: -Break A break statement is used to cause an exit from the loop and switch statements. It is used to provide labels in a switch statement. Char It is a fundamental data type and is used to declare character variables and arrays. Class class is used to create user defined data types. It binds together data and functions that operate on them. Class variables known as objects are the building blocks of OOP in C++. Default it is a default label in a switch statement. The control is transferred to this statement when none of the case labels match the expressions in switch. Do do is a control statement that creates a loop of operations. It is used with another keyword while.

Else else is used to specify an alternative path in a two-way branch control of execution. It is used with if statement. For If Int for is a control statement and is used to create a loop of iterative operations. if is a control statement that is used to test an expression to transfer the control to a particular statement depending upon the value of expression. it is one of the basic data types and is used to declare a variable that would be assigned integer values.

Private it is a visibility specifier for class members. A member listed under private is not accessible to any function other than the member functions of the class in which it is used. Public this is also a visibility specifier for the class members. A member declared as public in a class is accessible publicly. That is, any function can access a public member Structstruct is similar to a class and is used to create user-defined data types. It can group together the data items and functions that operate on them.

139

Das könnte Ihnen auch gefallen