This is a simple console-based Doctor Appointment System implemented in C++. The system allows users to book and check existing appointments with a doctor. It provides a basic menu-driven interface for interacting with the system.
-
Book Appointment: Users can book an appointment with the doctor by selecting an available time slot. If a slot is already booked, the system will not allow another booking for that time.
-
Check Existing Appointment: Users can check the existing appointments and see the available time slots.
-
Exit: To exit the program, you can choose this option. It will ask for confirmation before exiting.
-
Clone the repository to your local machine:
git clone https://github.com/swetamishra123/Doctor-Appointement-cpp.git
-
Navigate to the project directory:
cd Doctor-Appointement-cpp
-
Compile the code:
g++ -o doctor_appointment main.cpp
-
Run the program:
./doctor_appointment
- Book appointments for various hours of the day.
- View existing appointments and available time slots.
- Simple and user-friendly command-line interface.
- Basic error handling for invalid input.
-
Doctor Appointment System: This is the title of the system, indicating what the program does.
-
Menu Options:
- 1. Book Appointment: This option allows you to book an appointment with the doctor.
- 2. Check Existing Appointment: This option allows you to check existing appointments.
- 0. Exit: This option allows you to exit the program.
-
Enter your choice: You are prompted to enter your choice by typing a number (1, 2, or 0) and pressing Enter.
-
Book Appointment:
- If you select option 1, it will display available time slots, indicating which slots are available and which are booked.
- You can enter a choice by typing a letter (A to Z) corresponding to the time slot you want to book.
- If you select a time slot that is already booked, you'll receive an error message, and you need to choose a different time.
-
Check Existing Appointment:
- If you select option 2, it will show the summary of appointments. It lists available and booked time slots.
-
Exit Confirmation:
- If you select option 0 (Exit), the program asks for confirmation by typing 'y' for yes or 'n' for no. You can exit by typing 'y' or continue using the system by typing 'n'.
-
Invalid Choices:
- If you make an invalid selection or input, you'll receive an error message and be prompted to enter a valid choice.
-
Continuation:
- After performing any action (booking an appointment, checking appointments, etc.), you are prompted to press any key to continue. This allows you to return to the main menu.
----- Book Your Appointment ----
This line indicates that you are in the process of booking an appointment.
----- Availbale slots ----
This line shows the available time slots for booking.
Appointment Summary by hours:
This section is providing a summary of appointments by hours. It will show whether a particular time slot is available or booked.
A-> 09 - Available
B->10 - Available
C->11 - Available
D->12 - Available
E->13 - Available
F->14 - Available
G->15 - Available
H->16 - Available
I->17 - Available
J->18 - Available
K->19 - Available
L->20 - Available
M->21 - Booked
This part of the output is a summary of available time slots. Each letter from 'A' to 'M' represents an available hour. The arrow '->' is used to separate the letter from the corresponding hour. If it says "Available" next to a time slot, it means that appointment slot is currently open for booking. However, in this example, it shows that the time slot 'M' (which corresponds to 21:00) is already booked, as it says "Booked."
Here's an example of the data stored in "appointment.dat" based on the output:
- 'M:SWETA' means that the appointment slot 'M' (21:00) is booked by 'SWETA.'
- 'E:SNEHA' would indicate that the appointment slot 'E' (13:00) is booked by 'SNEHA.'
- 'K:Rajeev' would signify that the appointment slot 'K' (19:00) is booked by 'Rajeev.'
The format appears to be a single character representing the appointment slot followed by a colon and the name of the person who booked that slot.
In this example, you can see that the appointment slot 'M' is already booked, which is why it is labeled as "Booked" in the summary. The user is prompted to select an available slot for booking. If they select 'M' again, it would display an error message indicating that the slot is already booked, and they would need to choose a different available time slot.
If you want to contribute to this project, feel free to fork the repository and submit pull requests with your improvements and changes.
This project is open-source and available under the MIT License. You are free to use and modify the code as needed.
This Doctor Appointment System project was created bswetamishra123. If you have any questions or suggestions, please feel free to contact me at swetamishra@gmail.com
Enjoy using the Doctor Appointment System!