Joel 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

School Of Aeronautics,Neemrana

Project Report
on
”HOTEL MANAGEMENT SYSTEM”
submitted
in partial fulfillment
for the award of the Degree of
Bachelor of Technology
In Department of Aeronautical Engineering

Project Guide: Submitted By:


Miss. Barsha Abhisheka JOEL VARGHESE
Asst. Professor Reg.No.:1526

Department of Aeronautical Engineering

School of Aeronautics (Neemrana)


I-04, RIICO Industrial Area, Neemrana, Distt. Alwar, Rajasthan
Affiliated to Bikaner Technical University
NOVEMBER 2019
Page 1
School Of Aeronautics,Neemrana

Candidate’s Declaration

I hereby declare that the work, which is being presented in the Project Report, entitled
“HOTEL MANAGEMENT SYSTEM” in partial fulfillment for the award of Degree
of “Bachelor of Technology” in Department of Aeronautical Engineering and
submitted to the Department of Aeronautical Engineering, School of Aeronautics
(Neemrana), affiliated to Bikaner Technical University is a record of my own
investigations carried under the guidance of Miss Barsha Abhisheka, Department of
Aeronautical Engineering, School of Aeronautics(Neemrana).

JOEL VARGHESE
Registration Number: 1526
School of Aeronautics (Neemrana)

Counter Signed by
Miss Barsha Abhisheka

Page 2
School Of Aeronautics,Neemrana

Department of Aeronautical Engineering


School of Aeronautics (Neemrana)
I-04, RIICO Industrial Area, Neemrana, Distt. Alwar, Rajasthan
Affiliated to Bikaner Technical University
NOVEMBER 2019

Certificate

This is to certify that JOEL VARGHESE of first Semester, B.Tech. (Aeronautical


Engineering) 2019-20, has presented project report on “Hotel Management System”
in partial fulfillment for the award of the degree of Bachelor of Technology under
Bikaner Technical University, Bikaner.

Date: 30 November,2019

Miss Barsha Abhisheka Prof. C.C. Ashoka


Project Guide Director

Page 3
School Of Aeronautics,Neemrana

Acknowledgement

I would like to express my gratitude to Miss Barsha Abhisheka who has provided an
unmatched support and guidance in the project. I would also like to thank her for her
unparalleled determination and enthusiasm in accomplishment of the project
satisfactorily.
It has been a great honor to work under the aegis of the above mentioned professor of
the School of Aeronautics and also under the Director of School of Aeronautics,
Mr. C. C. Ashoka.

Joel Varghese
Reg. No.: - 1526
B.Tech.- Semester I
(Aeronautical Engineering)

Page 4
School Of Aeronautics,Neemrana

Contents

1. WHAT IS C LANGUAGE?.................................................
2. HISTORY…………………………………………………..
3. USES OF C LANGUAGE…………………………………
4. PROGRAM CODE………………………………………..
5. OUTPUT……………………………………………………
6. REFERENCE………………………………………………

Page 5
School Of Aeronautics,Neemrana

What is C language?

C is a high-level and general-purpose programming language that is ideal for developing


firmware or portable applications. Originally intended for writing system software, C
was developed at Bell Labs by Dennis Ritchie for the Unix Operating System in the early
1970s.
Ranked among the most widely used languages, C has a compiler for most computer
systems and has influenced many popular languages – notably C++.
C belongs to the structured, procedural paradigms of languages. It is proven, flexible and
powerful and may be used for a variety of different applications. Although high level, C
and assembly language share many of the same attributes .

Page 6
School Of Aeronautics,Neemrana

History
Early developments
Year C Standard

1972 Birth

1978 K&R C

1989/1990 ANSI C and ISO C

1999 C99

2011 C11

2017/2018 C18

The origin of C is closely tied to the development of the Unix operating system, originally
implemented in assembly language on a PDP-7 by Dennis Ritchie and Ken Thompson,
incorporating several ideas from colleagues. Eventually, they decided to port the operating
system to a PDP-11. The original PDP-11 version of Unix was also developed in assembly
language.
Thompson desired a programming language to make utilities for the new platform. At first,
he tried to make a Fortran compiler, but soon gave up the idea. Instead, he created a cut-
down version of the recently developed BCPL systems programming language. The
official description of BCPL was not available at the time, and Thompson modified the
syntax to be less wordy, producing the similar but somewhat simpler B.] However, few
utilities were ultimately written in B because it was too slow, and B could not take
advantage of PDP-11 features such as byte addressability.
In 1972, Ritchie started to improve B, which resulted in creating a new language C. The C
compiler and some utilities made with it were included in Version 2 Unix.
At Version 4 Unix released at Nov. 1973, the Unix kernel was extensively re-implemented
by C. By this time, the C language had acquired some powerful features such
as struct types.
Unix was one of the first operating system kernels implemented in a language other
than assembly. Earlier instances include the Multics system (which was written in PL/I)
and Master Control Program (MCP) for the Burroughs B5000 (which was written
in ALGOL) in 1961. In around 1977, Ritchie and Stephen C. Johnson made further
changes to the language to facilitate portability of the Unix operating system.
Johnson's Portable C Compiler served as the basis for several implementations of C on new
platforms.

Page 7
School Of Aeronautics,Neemrana

K&R C
In 1978, Brian Kernighan and Dennis Ritchie published the first edition of The C
Programming Language. book, known to C programmers as K&R, served for many years
as an informal specification of the language. The version of C that it describes is
commonly referred to as "K&R C". The second edition of the book covers the later ANSI
C standard, described below.
K&R introduced several language features:

 Standard I/O library


 data type
 data type
Even after the publication of the 1989 ANSI standard, for many years K&R C was still
considered the "lowest common denominator" to which C programmers restricted
themselves when maximum portability was desired, since many older compilers were still
in use, and because carefully written K&R C code can be legal Standard C as well.
In early versions of C, only functions that return types other than int must be declared if
used before the function definition; functions used without prior declaration were
presumed to return type int .
The int type specifiers which are commented out could be omitted in K&R C, but are
required in later standards.
Since K&R function declarations did not include any information about function
arguments, function parameter type checks were not performed, although some compilers
would issue a warning message if a local function was called with the wrong number of
arguments, or if multiple calls to an external function used different numbers or types of
arguments. Separate tools such as Unix's lint utility were developed that (among other
things) could check for consistency of function use across multiple source files.

ANSI C and ISO C


During the late 1970s and 1980s, versions of C were implemented for a wide variety
of mainframe computers, minicomputers, and microcomputers, including the IBM PC, as
its popularity began to increase significantly.
In 1983, the American National Standards Institute (ANSI) formed a committee, X3J11, to
establish a standard specification of C. X3J11 based the C standard on the Unix
Page 8
School Of Aeronautics,Neemrana

implementation; however, the non-portable portion of the Unix C library was handed off to
the IEEE working group 1003 to become the basis for the 1988 POSIX standard. In 1989,
the C standard was ratified as ANSI X3.159-1989 "Programming Language C". This
version of the language is often referred to as ANSI C, Standard C, or sometimes C89.
In 1990, the ANSI C standard (with formatting changes) was adopted by the International
Organization for Standardization (ISO) as ISO/IEC 9899:1990, which is sometimes called
C90. Therefore, the terms "C89" and "C90" refer to the same programming language.
ANSI, like other national standards bodies, no longer develops the C standard
independently, but defers to the international C standard, maintained by the working
group ISO/IEC JTC1/SC22/WG14.

C99
The C standard was further revised in the late 1990s, leading to the publication of ISO/IEC
9899:1999 in 1999, which is commonly referred to as "C99". It has since been amended
three times by Technical Corrigenda.

C99 introduced several new features, including inline functions, several new data
types , variable-length arrays and flexible array members, improved support for IEEE
754 floating point, support for variadic macros , and support for one-line comments
beginning with as in BCPL or C++. Many of these had already been implemented as
extensions in several C compilers.

C11
In 2007, work began on another revision of the C standard, informally called "C1X" until
its official publication on 2011-12-08

The C11 standard adds numerous new features to C and the library, including type generic
macros, anonymous structures, improved Unicode support, atomic operations, multi-
threading, and bounds-checked functions. It also makes some portions of the existing C99
library optional, and improves compatibility with C++.

Page 9
School Of Aeronautics,Neemrana

USES OF C LANGUAGE

C is widely used for systems programming in implementing operating


systems and embedded system applications, because C code, when written for portability,
can be used for most purposes, yet when needed, system-specific code can be used to
access specific hardware addresses and to perform type punning to match externally
imposed interface requirements, with a low run-time demand on system resources.
C can also be used for website programming using CGI as a "gateway" for information
between the Web application, the server, and the browser.] C is often chosen
over interpreted languages because of its speed, stability, and near-universal availability.
One consequence of C's wide availability and efficiency is that compilers, libraries
and interpreters of other programming languages are often implemented in C.
The reference implementations of Python, Perl and PHP, for example, are all written in C.
Because the layer of abstraction is thin and the overhead is low, C enables programmers to
create efficient implementations of algorithms and data structures, useful for
computationally intense programs. For example, the GNU Multiple Precision Arithmetic
Library, the GNU Scientific Library, Mathematica, and MATLAB are completely or
partially written in C.
C is sometimes used as an intermediate language by implementations of other languages.
This approach may be used for portability or convenience; by using C as an intermediate
language, additional machine-specific code generators are not necessary. C has some
features, such as line-number preprocessor directives and optional superfluous commas at
the end of initializer lists, that support compilation of generated code. However, some of
C's shortcomings have prompted the development of other C-based languages specifically
designed for use as intermediate languages, such as C--.
C has also been widely used to implement end-user applications. However, such
applications can also be written in newer, higher-level languages.

Page 10
School Of Aeronautics,Neemrana

PROGRAM CODE

#include<stdio.h>

#include<conio.h>

#include<ctype.h>

#include<stdlib.h>

#include<string.h>

#include<time.h>

void add(); //FUNCTIONS

void list();

void edit(); //GLOBALLY DECLARED FUNCTIONS N VARIABLE

void delete1();

void search();

struct CustomerDetails //STRUCTURE DECLARATION

char roomnumber[10];

char name[20];

char address[25];

char phonenumber[15];

char nationality[15];

char email[20];
Page 11
School Of Aeronautics,Neemrana

char period[10];

char arrivaldate[10];

}s;

int main(){ // MAIN FUNCTION

int i=0;

time_t t;

time(&t);

char customername;

char choice;

system("cls"); // FOR CLEARING SCREEN

printf("| |\n");

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

printf("\t\t* WELCOME TO HOTEL JOEL *\n");

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

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

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

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

printf("\t\t* CONTACT US:91-7306425373 *\n");

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

for(i=0;i<80;i++)

printf("-");
Page 12
School Of Aeronautics,Neemrana

printf("\nCurrent date and time : %s",ctime(&t));

for(i=0;i<80;i++)

printf("-");

printf(" \n Press any key to continue:");

getch();

system("cls");

while (1) // INFINITE LOOP

system("cls");

for(i=0;i<80;i++)

printf("-");

printf("\n");

printf(" ****************************** |MAIN MENU|


***************************** \n");

for(i=0;i<80;i++)

printf("-");

printf("\n");

printf("\t\t *Please enter your choice for menu*:");

printf("\n\n");

printf(" \n Enter 1 -> Book a room");

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

printf(" \n Enter 2 -> View Customer Record");

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

Page 13
School Of Aeronautics,Neemrana

printf(" \n Enter 3 -> Delete Customer Record");

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

printf(" \n Enter 4 -> Search Customer Record");

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

printf(" \n Enter 5 -> Edit Record");

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

printf(" \n Enter 6 -> Exit");

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

printf("\n");

for(i=0;i<80;i++)

printf("-");

printf("\nCurrent date and time : %s",ctime(&t));

for(i=0;i<80;i++)

printf("-");

choice=getche();

choice=toupper(choice);

switch(choice) // SWITCH STATEMENT

case '1':

add();break;

case '2':

list();break;

case '3':

delete1();break;
Page 14
School Of Aeronautics,Neemrana

case '4':

search();break;

case '5':

edit();break;

case '6':

system("cls");

printf("\n\n\t *****THANK YOU*****");

printf("\n\t FOR TRUSTING OUR SERVICE");

// Sleep(2000);

exit(0);

break;

default:

system("cls");

printf("Incorrect Input");

printf("\n Press any key to continue");

getch();

void add()

FILE *f;

char test;
Page 15
School Of Aeronautics,Neemrana

f=fopen("add.txt","a+");

if(f==0)

{ f=fopen("add.txt","w+");

system("cls");

printf("Please hold on while we set our database in your computer!!");

printf("\n Process completed press any key to continue!! ");

getch();

while(1)

system("cls");

printf("\n Enter Customer Details:");

printf("\n**************************");

printf("\n Enter Room number:\n");

scanf("\n%s",s.roomnumber);

fflush(stdin);

printf("Enter Name:\n");

scanf("%s",s.name);

printf("Enter Address:\n");

scanf("%s",s.address);

printf("Enter Phone Number:\n");

scanf("%s",s.phonenumber);

printf("Enter Nationality:\n");

scanf("%s",s.nationality);
Page 16
School Of Aeronautics,Neemrana

printf("Enter Email:\n");

scanf(" %s",s.email);

printf("Enter Period(\'x\'days):\n");

scanf("%s",&s.period);

printf("Enter Arrival date(dd\\mm\\yyyy):\n");

scanf("%s",&s.arrivaldate);

fwrite(&s,sizeof(s),1,f);

fflush(stdin);

printf("\n\n1 Room is successfully booked!!");

printf("\n Press esc key to exit, any other key to add another customer detail:");

test=getche();

if(test==27)

break;

fclose(f);

void list()

FILE *f;

int i;

if((f=fopen("add.txt","r"))==NULL)

exit(0);
Page 17
School Of Aeronautics,Neemrana

system("cls");

printf("ROOM ");

printf("NAME\t ");

printf("\tADDRESS ");

printf("\tPHONENUMBER ");

printf("\tNATIONALITY ");

printf("\tEMAIL ");

printf("\t\t PERIOD ");

printf("\t ARRIVALDATE \n");

for(i=0;i<118;i++)

printf("-");

while(fread(&s,sizeof(s),1,f)==1)

/*printf("ROOMNUMBER :\t%s\n",s.roomnumber);

printf("NAME:\t%s\n",,s.name);

printf("ADDRESS:\t%s\n",s.address);

printf("PHONENUMBER:\t%s\n",s.phonenumber);

printf("NATIONALITY \n");*/

printf("\n%s \t%s \t\t%s \t\t%s \t%s \t%s \t %s \t %s",s.roomnumber, s.name ,


s.address , s.phonenumber ,s.nationality ,s.email,s.period, s.arrivaldate);

printf("\n");

for(i=0;i<118;i++)

Page 18
School Of Aeronautics,Neemrana

printf("-");

fclose(f);

getch();

void delete1()

FILE *f,*t;

int i=1;

char roomnumber[20];

if((t=fopen("temp.txt","w"))==NULL)

exit(0);

if((f=fopen("add.txt","r"))==NULL)

exit(0);

system("cls");

printf("Enter the Room Number of the hotel to be deleted from the database: \n");

fflush(stdin);

scanf("%s",roomnumber);

while(fread(&s,sizeof(s),1,f)==1)

if(strcmp(s.roomnumber,roomnumber)==0)

{ i=0;

continue;
Page 19
School Of Aeronautics,Neemrana

else

fwrite(&s,sizeof(s),1,t);

if(i==1)

printf("\n\n Records of Customer in this Room number is not found!!");

//remove("E:/file.txt");

//rename("E:/temp.txt","E:/file.txt");

getch();

fclose(f);

fclose(t);

main();

fclose(f);

fclose(t);

remove("add.txt");

rename("temp.txt","add.txt");

printf("\n\nThe Customer is successfully removed....");

fclose(f);

fclose(t);

getch();

Page 20
School Of Aeronautics,Neemrana

void search()

system("cls");

FILE *f;

char roomnumber[20];

int flag=1;

f=fopen("add.txt","r+");

if(f==0)

exit(0);

fflush(stdin);

printf("Enter Room number of the customer to search its details: \n");

scanf("%s", roomnumber);

while(fread(&s,sizeof(s),1,f)==1)

if(strcmp(s.roomnumber,roomnumber)==0){

flag=0;

printf("\n\tRecord Found\n ");

printf("\nRoom Number:\t%s",s.roomnumber);

printf("\nName:\t%s",s.name);

printf("\nAddress:\t%s",s.address);

printf("\nPhone number:\t%s",s.phonenumber);

printf("\nNationality:\t%s",s.nationality);

printf("\nEmail:\t%s",s.email);

printf("\nPeriod:\t%s",s.period);
Page 21
School Of Aeronautics,Neemrana

printf("\nArrival date:\t%s",s.arrivaldate);

flag=0;

break;

if(flag==1){

printf("\n\tRequested Customer could not be found!");

getch();

fclose(f);

void edit()

FILE *f;

int k=1;

char roomnumber[20];

long int size=sizeof(s);

if((f=fopen("add.txt","r+"))==NULL)

exit(0);

system("cls");

printf("Enter Room number of the customer to edit:\n\n");

scanf("%[^\n]",roomnumber);

fflush(stdin);
Page 22
School Of Aeronautics,Neemrana

while(fread(&s,sizeof(s),1,f)==1)

if(strcmp(s.roomnumber,roomnumber)==0)

k=0;

printf("\nEnter Room Number :");

gets(s.roomnumber);

printf("\nEnter Name :");

fflush(stdin);

scanf("%s",&s.name);

printf("\nEnter Address :");

scanf("%s",&s.address);

printf("\nEnter Phone number :");

scanf("%f",&s.phonenumber);

printf("\nEnter Nationality :");

scanf("%s",&s.nationality);

printf("\nEnter Email :");

scanf("%s",&s.email);

printf("\nEnter Period :");

scanf("%s",&s.period);

printf("\nEnter Arrival date :");

scanf("%s",&s.arrivaldate);

fseek(f,size,SEEK_CUR); //to go to desired position infile

fwrite(&s,sizeof(s),1,f);
Page 23
School Of Aeronautics,Neemrana

break;

if(k==1){

printf("\n\nTHE RECORD DOESN'T EXIST!!!!");

fclose(f);

getch();

}else{

fclose(f);

printf("\n\n\t\tYOUR RECORD IS SUCCESSFULLY EDITED!!!");

getch();

Page 24
School Of Aeronautics,Neemrana

OUTPUTS

Page 25
School Of Aeronautics,Neemrana

Page 26
School Of Aeronautics,Neemrana

Page 27
School Of Aeronautics,Neemrana

REFERENCE

https://www.lovelycoding.org › 2012/04 › hotel-management-system

https://www.codewithc.com › Projects › C++ Projects

N.K PUBLISHERS PROGRAMME FOR PROBLEM SOLVING

Page 28

You might also like