GithubHelp home page GithubHelp logo

laibashakil / bed-breakfast-reservation-system Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

This is a centralized reservation system that streamlines the process of booking bed and breakfast accommodations. It simplifies the booking experience for guests and allows administrators to efficiently manage reservations from a single platform.

License: MIT License

C++ 100.00%

bed-breakfast-reservation-system's Introduction

Bed & Breakfast Room Reservation System

A user-friendly reservation system designed for bed and breakfast owners to manage their bookings. The system includes features such as room allocation, cancellation, and display of guest data. This program uses linked lists to store guest data, and file handling to store this data persistently in a text file. This program is suitable for small hotels or guesthouses with a limited number of rooms.

Prerequisites

  • C++ compiler
  • Windows OS

How to use

  • Clone the repository to your local machine
  • Navigate to the directory where the files are saved
  • Compile and run the program using your C++ compiler
  • Follow the instructions on the screen to allocate or cancel a room, check the room number of a guest or display all guests' information
  • The details of each guest are saved in guests.txt

Classes

  1. guest: This is a class representing the guests who will be allocated rooms. It has properties such as name, CNIC, roomNum, guestEmail, and contactNo representing the guest's name, identification number, room number, email, and contact number, respectively. The guest class also has a pointer to the next guest in the linked list.
  2. Room: This class represents the hotel rooms and their allocation to guests. It has a private member head, which is a pointer to the first guest object in a linked list. The Room class has functions such as checknameinput(), checkroomNuminput(), checkCNIC(), checkcontactNo(), validateEmail(), checkguestEmail(), allocate(), and cancel().

Functions

  1. checknameinput(): This function is responsible for taking input of the guest's name, removing any spaces in the input, and validating that the input only contains alphabetic characters.
  2. checkroomNuminput(): This function is responsible for taking input of the guest's room number, validating that the input only contains digits, and checking if the entered room number is already in use by another guest.
  3. checkCNIC(): This function is responsible for taking input of the guest's 13-digit CNIC number and validating that the input is exactly 13 digits long.
  4. checkcontactNo(): This function is responsible for taking input of the guest's contact number, validating that the input is exactly 11 digits long, and ensuring that the input only contains digits.
  5. validateEmail(): This function takes an email address as input and returns a boolean value indicating whether the input is a valid email address or not.
  6. checkguestEmail(): This function is responsible for taking input of the guest's email address, validating that the input is a valid email address using the validateEmail() function, and prompting the user to enter a valid email address if the input is not valid.
  7. allocate(): This function is responsible for allocating a room to a guest. It takes input of the guest's name, room number, CNIC number, contact number, and email address using the above-mentioned functions. It then appends this information to a text file and creates a new guest object with the input information and adds it to the linked list of guests.
  8. cancel(): This function is responsible for canceling the allocation of a room to a guest. It takes input of the guest's name and room number using the checknameinput() and checkroomNuminput() functions, respectively. It then searches the linked list of guests for a matching guest object and deletes it.
  9. check(): This function takes input from the user, checks if there is a guest with that name in the linked list, and displays the guest's information if found. If there is no such guest, it displays a message saying "No such guest in our list!"
  10. sortList(): This function is responsible for sorting the linked list in alphabetical order based on the guest names. It uses a selection sort algorithm to do this. It starts with the first guest in the list, then compares its name with the names of all the other guests in the list. If it finds a guest with a name that comes before the current guest's name, it swaps the data of the two guests. It repeats this process until the end of the list is reached.
  11. display(): This function is responsible for displaying all the guests in the linked list in alphabetical order by name. It calls the sortList() function to sort the list first and then iterates through the list and displays each guest's information, along with their assigned guest number. If the list is empty, it displays a message saying "There are no guests in the list."

File Handling

  • The program uses file handling to store the guest details in a file named guests.txt.
  • When a guest room is allocated, their details are appended to the end of the file.
  • The file is opened in append mode to prevent overwriting the existing contents.

Contributing

If you would like to contribute to the program, please fork the repository and submit a pull request. Contributions are welcome and appreciated.

License

This project is licensed under the MIT License - see the LICENSE file for details.

bed-breakfast-reservation-system's People

Contributors

laibashakil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.