Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include<windows.h>
- #include<string>
- using namespace std;
- struct Name // structure for naming in program
- {
- char first[20]; //character arrays for the names used in program..
- char last[20];
- char date[20];
- int room;
- char cnic[20],mob[20];
- };
- //\\Functions prototyping//\/\\
- void vacant_rooms(); //for vacant rooms|
- void customer_reserve(); //for reservation |
- void login(); //for login |
- void check(); //for the guest history
- void user_total(); //for user total on the time checkout
- void loading(); // for loading bar
- void help(); //for helping the user to operate the application
- void about(); //for about the program
- void del_resdata(); // in order delete
- //------------------------.>//
- int main()
- {
- system("color 34");
- int a;
- int choice;
- char again;
- char x[20];
- cout<<endl;
- cout<<" * * "<<endl;
- cout<<" ** * "<<endl;
- cout<<" *** Welcome to the Hotel Reservation Application ****"<<endl;
- cout<<" ** ** "<<endl;
- cout<<" * * "<<endl;
- cout<<endl;
- Beep(2020,1100); // causes the computer to beep
- char l=219; //for loading bar
- cout<<"Please wait while system is analyzing the data\n";
- for ( int i=0; i<10 ; i++)
- {
- Beep(2000,500);
- cout<<l;
- }
- cout<<endl;
- cout<<"______________________________"<<endl;
- cout<<"Please Enter Username and Password to proceed: "<<endl;
- cout<<endl;
- login(); //function calling of login
- cout<<"______________________________"<<endl;
- cout<<endl;
- do
- {
- cout<<"Welcome to the Main Menu "<<endl;
- cout<<endl;
- cout<<"Press 1 to Reserve a room. "<<endl;
- cout<<endl;
- cout<<"Press 2 to see the vacant rooms. "<<endl;
- cout<<endl;
- cout<<"Press 3 to check out a room. "<<endl;
- cout<<endl;
- cout<<"Press 4 to see the history of reserved rooms. "<<endl;
- cout<<endl;
- cout<<"Press 5 to Delete the Reservation data. "<<endl;
- cout<<endl;
- cout<<"Press 6 to see about the Application. "<<endl;
- cout<<endl;
- cout<<"Press 7 for help. "<<endl;
- cout<<endl;
- cout<<"Press 0 to Exit application. "<<endl;
- cout<<"Enter Here_: ";
- cin>>a;
- cout<<"_____________________________________"<<endl;
- cout<<endl;
- switch(a)
- {
- cout<<"________________________________________"<<endl;
- case 0:
- break;
- case 1:
- cout<<" * *"<<endl;
- cout<<" ** Welcome to the Reservation Menu **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- customer_reserve(); // funtion calling
- break;
- case 2:
- cout<<" * *"<<endl;
- cout<<" ** Welcome to the Vacant Rooms **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- vacant_rooms(); ///funtion calling
- break;
- case 3:
- cout<<" * *"<<endl;
- cout<<"** Welcome to the User Total Menu **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- user_total(); //function calling
- break;
- case 4:
- cout<<" * *"<<endl;
- cout<<" ** Welcome to the History Menu **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- check(); //function calling
- break;
- case 5:
- cout<<" * *"<<endl;
- cout<<" ** Welcome to Delete Reservation data function **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- del_resdata(); //function calling
- break;
- case 6:
- cout<<" * *"<<endl;
- cout<<" ** About the Application **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- about(); //function calling
- break;
- case 7:
- cout<<" * *"<<endl;
- cout<<" ** Welcome to the Help **"<<endl;
- cout<<" * *"<<endl;
- cout<<endl;
- cout<<endl;
- help(); //function calling
- break;
- default:
- cout<<"you have enter an invalid Choice "<<endl;
- cout<<endl;
- }
- cout<<"Press 1 to go back into MAIN Menu or 0 to terminate the program: ";
- cin>>again;
- cout<<"___________________________________"<<endl;
- cout<<endl;
- }
- while (again=='1');
- cout<<"Thankyou! for using Hotel Reservation application."<<endl;
- cout<<"Have a nice day! "<<endl;
- cout<<endl;
- cout<<"Copyright(C) 2015. programming passion"<<endl;
- cout<<endl;
- cout<<"_________________________________________"<<endl;
- system ("pause");
- }
- //....................................................................//
- //....................................................................//
- void user_total() //funtion definition of function user_total
- {
- int choice,days,total1;
- char AC,again;
- int c=1000;
- int single= 3000;
- int doubl=4500;
- int suit=6000;
- int time=24;
- int service=300;
- do
- {
- cout<<"Which kind of Room did the guest stayed in? "<<endl;
- cout<<endl;
- cout<<" 1.Single Rooms "<<endl;
- cout<<endl;
- cout<<" 2.Double Rooms "<<endl;
- cout<<endl;
- cout<<" 3.Suits "<<endl;
- cout<<endl;
- cout<<"Select 1,2 or 3 . "<<endl;
- cout<<endl;
- cout<<"Enter Your CHoice Here_: ";
- cin>>choice;
- cout<<"__________________________________"<<endl;
- switch(choice)
- {
- case 1:
- cout<<"You have Selected single room. "<<endl;
- cout<<endl;
- cout<<" For How many days did the guest stayed: ";
- cin>>days;
- cout<<endl;
- cout<<" Press Y for A/c and N for without A/c: ";
- cin>>AC;
- cout<<endl;
- if (AC == 'Y' || AC == 'y')
- {
- total1 =(c+single+time+service)*days;
- cout<<"Your Total Total bill + service tax = ("<<total1<<" Rs.)"<<endl;
- cout<<endl;
- cout<<"______________________________"<<endl;
- }
- else if (AC == 'N' || AC == 'n')
- {
- total1=(single+time+service) * days;
- cout<<"Your Total Total bill + service tax = ("<<total1<<" Rs.)"<<endl;
- cout<<endl;
- cout<<"_______________________________"<<endl;
- }
- break;
- case 2:
- cout<<"You Have Selected Double room."<<endl;
- cout<<endl;
- cout<<" For How many days did the guest stayed: ";
- cin>>days;
- cout<<endl;
- cout<<" Press Y for A/c and N for without A/c: ";
- cin>>AC;
- cout<<endl;
- if (AC == 'Y' || AC == 'y')
- {
- total1 =(c+doubl+time+service)*days;
- cout<<"Your Total Total bill + service tax = ("<<total1<<" Rs.)"<<endl;
- cout<<endl;
- cout<<"__________________________________"<<endl;
- }
- else if (AC == 'N' || AC == 'n')
- {
- total1=(doubl+time+service) * days;
- cout<<"Your Total Total bill + service tax = ("<<total1<<" Rs.)"<<endl;
- cout<<endl;
- cout<<"_______________________________________"<<endl;
- }
- break;
- case 3:
- cout<<"You Have Selected Suit. "<<endl;
- cout<<endl;
- cout<<" For How many days did the guest stayed: ";
- cin>>days;
- cout<<endl;
- cout<<" Press Y for A/c and N for without A/c: ";
- cin>>AC;
- cout<<endl;
- if (AC == 'Y' || AC == 'y')
- {
- total1 =(c+suit+time+service)*days;
- cout<<"Your Total Total bill + service tax = ("<<total1<<" Rs.)"<<endl;
- cout<<endl;
- cout<<"_______________________________________"<<endl;
- }
- else if (AC == 'N' || AC == 'n')
- {
- total1=(suit+time+service) * days;
- cout<<"Your Total Total bill + service tax = ("<<total1<<" Rs.)"<<endl;
- cout<<endl;
- cout<<"__________________________________________"<<endl;
- }
- break;
- default:
- cout<<"you have enter an invalid Choice "<<endl;
- cout<<endl;
- }
- cout<<"Do you want to checkout for another room? (Y/N): ";
- cin>>again;
- cout<<"___________________________________"<<endl;
- cout<<endl;
- }
- while(again == 'y' || again == 'Y');
- }
- //....................................................................//
- //....................................................................//
- void customer_reserve() //function definition
- {
- Name guest; // guest is the name structure
- Name guest2;
- char choicedo; //for enter more data
- do
- {
- ofstream file;
- file.open("User info input.txt",ios::out | ios::app); //openning txt file
- if(!file)
- {
- cout<<"Error: Cannot open file.\n";
- system("pause");
- }
- cout<<"Enter The Room # to be Reserved: ";
- cin>>guest.room;
- cin.ignore(); // to skip the new line character
- cout<<endl;
- cout<<"Enter Guest's First Name: ";
- cin.getline(guest.first, 20);
- cout<<endl;
- cout<<"Enter Guest's Last Name: ";
- cin.getline(guest.last, 20);
- cout<<endl;
- cout<<"Enter The Mobile no. of The Customer: +";
- cin.getline(guest.mob, 20);
- cout<<endl;
- cout<<"Enter The CNIC of The Customer: ";
- cin.getline(guest.cnic, 20);
- cout<<endl;
- cout<<"The Name of Manager in Charge: ";
- cin.getline(guest2.first, 20);
- cout<<endl;
- cout<<endl;
- cout<<"Date: ";
- cin.getline(guest.date, 20);
- cout<<endl;
- int a; ///for choice
- /////////////
- cout<<"Press 1 to Save or 2 to cancel: ";
- cout<<endl;
- cin>>a;
- if(a==1)
- {
- cout<<endl;
- file<<" Guests Info"<<endl;
- cout<<endl;
- file<<"------------------------------------------------------------"<<endl;
- file<<endl;
- file<<" Reservation Data of Room no.: "<<guest.room<<endl;
- file<<endl;
- file<<"The Name of the Guest is: "<<guest.first<<" "<<guest.last<<endl;
- file<<endl;
- file<<"Mobile No.: +"<<guest.mob<<endl;
- file<<endl;
- file<<"CNIC No.: "<<guest.cnic<<endl;
- file<<endl;
- file<<"Name of Manager in Charge is: "<<guest2.first<<endl;
- file<<endl;
- file<<"Date: "<<guest.date<<endl;
- file<<endl;
- file<<endl;
- file<<"------------------------------------------------------------"<<endl;
- file.close();
- cout<<"Record Saved..."<<endl;
- cout<<"__________________________________"<<endl;
- cout<<endl;
- }
- else
- {
- cout<<"Record Was Not Saved"<<endl;
- cout<<"____________________________________"<<endl;
- cout<<endl;
- }
- cout<<"Enter Y To input an other data or Enter N to Exit: ";
- cin>>choicedo;
- cout<<"_____________________________________"<<endl;
- cout<<endl;
- }
- while (choicedo=='y' || choicedo=='Y'); //to enter more data
- //}
- }
- //....................................................................//
- //....................................................................//
- void vacant_rooms() //function definition
- {
- ifstream infile,infile2,infile3; //ifstream for file reading
- char name[89],name2[89],name3[89],name4[100];
- int see;
- char again;
- do
- {
- cout<<"Press 1 to see the list of Single Rooms. "<<endl;
- cout<<endl;
- cout<<"Press 2 to See the list of Double Rooms. "<<endl;
- cout<<endl;
- cout<<"Press 3 to See the list of Suits. "<<endl;
- cout<<endl;
- cout<<"Enter Your Choice Here_: ";
- cin>>see;
- cout<<endl;
- switch(see)
- {
- case 1:
- infile.open("infoVS.txt",ios::in);
- if (!infile)
- {
- cout<<"File not found."<<endl;
- exit(1);
- }
- else
- {
- while(!infile.eof())
- {
- infile>>name>>name2>>name3;
- cout<<name<<" "<<name2<<" "<<name3<<endl;
- cout<<endl;
- }
- infile.close(); //closing the file
- }
- break;
- case 2:
- infile2.open("infoVD.txt",ios::in);
- if(!infile2)
- {
- cout<<"File not found."<<endl;
- exit(1);
- }
- else
- {
- while(!infile2.eof())
- {
- infile2>>name>>name2>>name3;
- cout<<name<<" "<<name2<<" "<<name3<<endl;
- cout<<endl;
- }
- infile2.close();
- }
- break;
- case 3:
- infile3.open("infoVSu.txt",ios::in); // opening file
- if(!infile3)
- {
- cout<<"File not found."<<endl;
- exit(1);
- }
- else
- {
- while(!infile3.eof())
- {
- infile3>>name>>name2>>name3;
- cout<<name<<" "<<name2<<" "<<name3<<endl;
- cout<<endl;
- }
- infile3.close();
- }
- break;
- default:
- cout<<"You have entered an invalid choice"<<endl;
- cout<<endl;
- }
- cout<<"Do you want to see the List of vacant Rooms again? (Y/N): ";
- cin>>again;
- cout<<endl;
- }while (again=='Y' || again=='y');
- cout<<endl;
- }
- //....................................................................//
- //....................................................................//
- void login() //function calling
- {
- char log_file1[20], pass_file1[20];
- char log_file2[20], pass_file2[20];
- ifstream username,passward;
- username.open("user.txt");
- if(!username)
- {
- cout<<"File Not Found....";
- exit(1);
- }
- passward.open("pass.txt");
- if(!passward)
- {
- cout<<"File Not Found....";
- exit(1);
- }
- // reading username from file 2....
- username.getline(log_file2, 50);
- while (strcmp(log_file1, log_file2))
- {
- cout<<"\nUser Name: ";
- cin.getline(log_file1, 50);
- if (strcmp(log_file1, log_file2) ==0) //comparing the username
- break;
- else
- Beep(3320,400);
- cout<<"\nInvalid Username.\n";
- }
- passward.getline(pass_file2, 50); // reading password from file 2
- while (strcmp(pass_file1, pass_file2) !=0)
- {
- cout<<"\nPassword: ";
- cin.getline(pass_file1, 50);
- if (strcmp(pass_file1, pass_file2) ==0) //comparing the password
- cout<<"\n\t Logged in Successfully!!!" <<endl<<endl<<endl;
- else
- Beep(3320,400);
- cout<<"\nInvalid Password\n";
- }
- username.close(); // closing the file
- passward.close(); // closing the file
- }
- //....................................................................//
- //function definition ended
- //....................................................................//
- void check() /// function definition
- {
- char doagain;
- do
- {
- fstream data;
- char word[100];
- data.open("User info input.txt",ios::in);
- cout<<endl;
- if(!data)
- {
- cout<<"File not found."<<endl;
- exit(1);
- }
- else
- {
- while(!data.eof())
- {
- data.getline(word,100);
- cout<<word<<"\n";
- data.getline(word,100);
- cout<<word<<"\n";
- data.getline(word,100);
- cout<<word<<"\n";
- data.getline(word,100);
- cout<<word<<"\n";
- }
- data.close();
- cout<<"Press Y to see the history again or N to cancel.";
- cin>>doagain;
- cout<<"___________________________________"<<endl;
- cout<<endl;
- }
- }
- while (doagain=='y' || doagain=='Y');
- }
- //....................................................................//
- void del_resdata() ///function definition
- {
- char again;
- int x;
- fstream deletefile;
- do
- {
- cout<<"Enter 1 to delete the reservation data or 2 to cancel: ";
- cin>>x;
- cout<<endl;
- if (x==1)
- {
- deletefile.open("User info input.txt", ios::out | ios::trunc); //trunc for delete data
- if(!deletefile)
- {
- cout<<"File not found."<<endl;
- exit(1);
- }
- else
- {
- cout<<"Data has been deleted from the file."<<endl;
- cout<<endl;
- }
- }
- else
- {
- cout<<"Data not deleted.."<<endl;
- cout<<endl;
- }
- cout<<"Enter Y to run this function again or N to cancel: ";
- cin>>again;
- cout<<endl;
- cout<<"_____________________________________________"<<endl;
- }
- while (again=='Y' || again=='y');
- deletefile.close();
- }
- void about()
- {
- cout<<"About the Application"<<endl;
- cout<<"______________________________________"<<endl;
- cout<<endl;
- cout<<"This application is specially made for Hotel Reservation to "<<endl;
- cout<<"Organize data and to perform tasks, which can be useful for "<<endl;
- cout<<"Reservation.It can recored and analyze data of guests.With "<<endl;
- cout<<"this application you can not only see the past history of "<<endl;
- cout<<"guests,stayed in the hotel but you can also reserve rooms "<<endl;
- cout<<"for the future as well.You can also calculate the bill of "<<endl;
- cout<<"guests on the basis of time they have spent in the hotel "<<endl;
- cout<<endl;
- cout<<"This application is user friendly and one can easily use "<<endl;
- cout<<"this application.Thank you!"<<endl;
- cout<<endl;
- cout<<"Copyright(C) 2015 programming passion"<<endl;
- cout<<"______________________________________________"<<endl;
- }
- //=======>Programming passion ===========>//
- //For more info visit our site googler700.blogspot.com??///
- void help()
- {
- cout<<endl;
- cout<<"This application will work according to the desired entries by "<<endl;
- cout<<"the user.The reservation data will be stored in a text file present "<<endl;
- cout<<"where the application is located.If the text file is not present "<<endl;
- cout<<"the program will not work properly and will terminate.Follow the "<<endl;
- cout<<"displayed on the screen.Select the proper option to operate "<<endl;
- cout<<"instructions the application.Goodluck! "<<endl;
- cout<<endl;
- }
- ___________________________________________________________________________________________________
- #include "conio.h"
- #include "iostream.h"
- #include "graphics.h"
- #include "stdio.h"
- #include "dos.h"
- #include "process.h"
- void logo()
- {
- int gdriver=DETECT,gmode;
- initgraph(&gdriver,&gmode,"C:\\TURBOC3\\BGI");
- rectangle(250,30,387,48);
- rectangle(275,143,398,160);
- rectangle(275,175,398,192);
- }
- void main()
- {
- clrscr();
- char u[20],p[20];
- logo();
- gotoxy(34,3);
- cout<<"CodingSec Login";
- gotoxy(25,10);
- cout<<"Username:";
- gotoxy(25,12);
- cout<<"Password:";
- gotoxy(51,10);
- cout<<"(Press enter after entering)";
- gotoxy(51,12);
- cout<<"(8 characters only)";
- gotoxy(36,10);
- gets(u);
- gotoxy(36,12);
- for(int i=0;i<8;++i)
- {
- p[i]=getch();
- if(p[i]=='b')
- {
- printf("b b");
- i=i-2;
- }
- else
- cout<<"*";
- }
- p[i]=' ';
- getch();
- gotoxy(20,20);
- cout<<"Plz wait Redirecting";
- for(int j=0;j<8;++j)
- {
- sleep(1);
- cout<<".";
- }
- }
- #include<iostream.h>
- #include<conio.h>
- #include<fstream.h>
- #include<stdio.h>
- #include<dos.h>
- class hotel
- {
- int room_no;
- char name[30];
- char address[50];
- char phone[10];
- public:
- void main_menu(); //to dispay the main menu
- void add(); //to book a room
- void display(); //to display the customer record
- void rooms(); //to display alloted rooms
- void edit(); //to edit the customer record
- int check(int); //to check room status
- void modify(int); //to modify the record
- void delete_rec(int); //to delete the record
- };
- void hotel::main_menu()
- {
- int choice;
- while(choice!=5)
- {
- clrscr();
- cout<<"\n\t\t\t\t*************";
- cout<<"\n\t\t\t\t* MAIN MENU *";
- cout<<"\n\t\t\t\t*************";
- cout<<"\n\n\n\t\t\t1.Book A Room";
- cout<<"\n\t\t\t2.Customer Record";
- cout<<"\n\t\t\t3.Rooms Allotted";
- cout<<"\n\t\t\t4.Edit Record";
- cout<<"\n\t\t\t5.Exit";
- cout<<"\n\n\t\t\tEnter Your Choice: ";
- cin>>choice;
- switch(choice)
- {
- case 1: add();
- break;
- case 2: display();
- break;
- case 3: rooms();
- break;
- case 4: edit();
- break;
- case 5: break;
- default:
- {
- cout<<"\n\n\t\t\tWrong choice!!!";
- cout<<"\n\t\t\tPress any key to continue!!";
- getch();
- }
- }
- }
- }
- void hotel::add()
- {
- clrscr();
- int r,flag;
- ofstream fout("Record.dat",ios::app);
- cout<<"\n Enter Customer Detalis";
- cout<<"\n **********************";
- cout<<"\n\n Room no: ";
- cin>>r;
- flag=check(r);
- if(flag)
- cout<<"\n Sorry..!!!Room is already booked";
- else
- {
- room_no=r;
- cout<<" Name: ";
- gets(name);
- cout<<" Address: ";
- gets(address);
- cout<<" Phone No: ";
- gets(phone);
- fout.write((char*)this,sizeof(hotel));
- cout<<"\n Room is booked!!!";
- }
- cout<<"\n Press any key to continue!!";
- getch();
- fout.close();
- }
- void hotel::display()
- {
- clrscr();
- ifstream fin("Record.dat",ios::in);
- int r,flag;
- cout<<"\n Enter room no: ";
- cin>>r;
- while(!fin.eof())
- {
- fin.read((char*)this,sizeof(hotel));
- if(room_no==r)
- {
- clrscr();
- cout<<"\n Cusromer Details";
- cout<<"\n ****************";
- cout<<"\n\n Room no: "<<room_no;
- cout<<"\n Name: "<<name;
- cout<<"\n Address: "<<address;
- cout<<"\n Phone no: "<<phone;
- flag=1;
- break;
- }
- }
- if(flag==0)
- cout<<"\n Sorry Room no. not found or vacant!!";
- cout<<"\n\n Press any key to continue!!";
- getch();
- fin.close();
- }
- void hotel::rooms()
- {
- clrscr();
- ifstream fin("Record.dat",ios::in);
- cout<<"\n\t\t\tList Of Rooms Allotted";
- cout<<"\n\t\t\t*********************";
- cout<<"\n\n Room No.\tName\t\tAddress\t\tPhone No.\n";
- while(!fin.eof())
- {
- fin.read((char*)this,sizeof(hotel));
- cout<<"\n\n "<<room_no<<"\t\t"<<name;
- cout<<"\t\t"<<address<<"\t\t"<<phone;
- }
- cout<<"\n\n\n\t\t\tPress any key to continue!!";
- getch();
- fin.close();
- }
- void hotel::edit()
- {
- clrscr();
- int choice,r;
- cout<<"\n EDIT MENU";
- cout<<"\n *********";
- cout<<"\n\n 1.Modify Customer Record";
- cout<<"\n 2.Delete Customer Record";
- cout<<"\n Enter your choice: ";
- cin>>choice;
- clrscr();
- cout<<"\n Enter room no: ";
- cin>>r;
- switch(choice)
- {
- case 1: modify(r);
- break;
- case 2: delete_rec(r);
- break;
- default: cout<<"\n Wrong Choice!!";
- }
- cout<<"\n Press any key to continue!!!";
- getch();
- }
- int hotel::check(int r)
- {
- int flag=0;
- ifstream fin("Record.dat",ios::in);
- while(!fin.eof())
- {
- fin.read((char*)this,sizeof(hotel));
- if(room_no==r)
- {
- flag=1;
- break;
- }
- }
- fin.close();
- return(flag);
- }
- void hotel::modify(int r)
- {
- long pos,flag=0;
- fstream file("Record.dat",ios::in|ios::out|ios::binary);
- while(!file.eof())
- {
- pos=file.tellg();
- file.read((char*)this,sizeof(hotel));
- if(room_no==r)
- {
- cout<<"\n Enter New Details";
- cout<<"\n *****************";
- cout<<"\n Name: ";
- gets(name);
- cout<<" Address: ";
- gets(address);
- cout<<" Phone no: ";
- gets(phone);
- file.seekg(pos);
- file.write((char*)this,sizeof(hotel));
- cout<<"\n Record is modified!!";
- flag=1;
- break;
- }
- }
- if(flag==0)
- cout<<"\n Sorry Room no. not found or vacant!!";
- file.close();
- }
- void hotel::delete_rec(int r)
- {
- int flag=0;
- char ch;
- ifstream fin("Record.dat",ios::in);
- ofstream fout("temp.dat",ios::out);
- while(!fin.eof())
- {
- fin.read((char*)this,sizeof(hotel));
- if(room_no==r)
- {
- cout<<"\n Name: "<<name;
- cout<<"\n Address: "<<address;
- cout<<"\n Pone No: "<<phone;
- cout<<"\n\n Do you want to delete this record(y/n): ";
- cin>>ch;
- if(ch=='n')
- fout.write((char*)this,sizeof(hotel));
- flag=1;
- }
- else
- fout.write((char*)this,sizeof(hotel));
- }
- fin.close();
- fout.close();
- if(flag==0)
- cout<<"\n Sorry room no. not found or vacant!!";
- else
- {
- remove("Record.dat");
- rename("temp.dat","Record.dat");
- }
- }
- void main()
- {
- hotel h;
- textmode(C80);
- textbackground(WHITE);
- textcolor(RED);
- clrscr();
- cout<<"\n\t\t\t****************************";
- cout<<"\n\t\t\t* HOTEL MANAGEMENT PROJECT *";
- cout<<"\n\t\t\t****************************";
- sleep(2);
- cout<<"\n\n\n\n\t\tMade By:";
- sleep(2);
- cout<<" The Crazy Programmer";
- sleep(2);
- cout<<"\n\n\n\n\n\t\t\t\tPress any key to continue!!";
- getch();
- h.main_menu();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement