Professional Documents
Culture Documents
Joel 3
Joel 3
Joel 3
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
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
Certificate
Date: 30 November,2019
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?
Page 6
School Of Aeronautics,Neemrana
History
Early developments
Year C Standard
1972 Birth
1978 K&R 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:
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
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 list();
void delete1();
void search();
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 i=0;
time_t t;
time(&t);
char customername;
char choice;
printf("| |\n");
printf("\t\t* *\n");
printf("\t\t* *\n");
printf("\t\t* *\n");
printf("\t\t*************************************************\n\n\n");
for(i=0;i<80;i++)
printf("-");
Page 12
School Of Aeronautics,Neemrana
for(i=0;i<80;i++)
printf("-");
getch();
system("cls");
system("cls");
for(i=0;i<80;i++)
printf("-");
printf("\n");
for(i=0;i<80;i++)
printf("-");
printf("\n");
printf("\n\n");
printf("\n------------------------");
printf("\n----------------------------------");
Page 13
School Of Aeronautics,Neemrana
printf("\n-----------------------------------");
printf("\n-----------------------------------");
printf("\n-----------------------");
printf("\n-----------------");
printf("\n");
for(i=0;i<80;i++)
printf("-");
for(i=0;i<80;i++)
printf("-");
choice=getche();
choice=toupper(choice);
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");
// Sleep(2000);
exit(0);
break;
default:
system("cls");
printf("Incorrect Input");
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");
getch();
while(1)
system("cls");
printf("\n**************************");
scanf("\n%s",s.roomnumber);
fflush(stdin);
printf("Enter Name:\n");
scanf("%s",s.name);
printf("Enter Address:\n");
scanf("%s",s.address);
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);
scanf("%s",&s.arrivaldate);
fwrite(&s,sizeof(s),1,f);
fflush(stdin);
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 ");
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");
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)
//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");
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);
scanf("%s", roomnumber);
while(fread(&s,sizeof(s),1,f)==1)
if(strcmp(s.roomnumber,roomnumber)==0){
flag=0;
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){
getch();
fclose(f);
void edit()
FILE *f;
int k=1;
char roomnumber[20];
if((f=fopen("add.txt","r+"))==NULL)
exit(0);
system("cls");
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;
gets(s.roomnumber);
fflush(stdin);
scanf("%s",&s.name);
scanf("%s",&s.address);
scanf("%f",&s.phonenumber);
scanf("%s",&s.nationality);
scanf("%s",&s.email);
scanf("%s",&s.period);
scanf("%s",&s.arrivaldate);
fwrite(&s,sizeof(s),1,f);
Page 23
School Of Aeronautics,Neemrana
break;
if(k==1){
fclose(f);
getch();
}else{
fclose(f);
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
Page 28