Untitled
unknown
c_cpp
2 years ago
19 kB
9
Indexable
#include <iostream> #include <string> #ifdef _WIN32 #include <Windows.h> #else #include <unistd.h> #endif using namespace std; void clear_console(){ #ifdef _WIN32 system("cls"); #else system("clear"); #endif } //intro animation void Intro(){ float sleep1=0.1; cout<<" .^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^. "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" J#&&&&&&&&&&&&&#&&&#####&&#####&&&&&&&&&&&#J "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" G####&7^&#:Y&J:~:?#7^.^7#?.~~~G&Y:#########G "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" G####&~ J? 7# !&J G&P 5#&~ JJJB&7 B########G "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" G####&~ J? 7# !&J G&P 5&&~ JJJB&7 B########G "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" G&###&?^&#:Y&J:~:?#&G.G&&?.~~~G&Y.~~~5&###&G "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" P#BBBBBBBBBBB#BBB#BBBBBBBBBBBBBBBBBBBBBBBB#P "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" ......^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...... "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" 5######################################################5 "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" :555555555555555555555555555555555555555555555555555555: "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" .^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^. "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !5YYYYJ!!!!!!!?YYYYYY7!!!!!!7YYYYYY?!!!!!!!JYYYY5! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY: ????J: YYYYY7 !????! 7YYYYY :J???? :YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY:.&&&&&! YYYYY7 G&&&&G 7YYYYY !&&&&&.:YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY:.####&! YYYYY7 P####P 7YYYYY !&####.:YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY:.#&##&! JYYYY7 P&##&P 7YYYYJ !&##&#.:YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY^ ~~~~~..YYYYY7 ^~~~~^ 7YYYYY..~~~~~ ^YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYYYJ?????JJYYYYYYJ??????JYYYYYYJJ?????JYYYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYYJJ??????JYYYYYYJ??????JYYYYYYJ??????JJYYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY^ ~~~~~..YYYYY7 :~^^~: 7YYYYY..~~~~~ ^YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY:.#&&&&! JYYYY7 P####P 7YYYYJ !&&&&#.:YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY:.####&! YYYYY7 5#BB#5 7YYYYY !&####.:YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY:.&&&&&! YYYYY7 5#BB#5 7YYYYY !&&&&&.:YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !YYYYY: 7????. YYYYY7 5#BB#5 7YYYYY .????7 :YYYYY! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" !5YYYYJ7!!!!!7?YYYY57 P####P 75YYYY?7!!!!!7JYYYY5! "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" :~^^^^~~~~~~~~~^^^^~: ~?77?~ :~^^^^~~~~~~~~~^^^^~: "<<endl; #ifdef _WIN32 Sleep(sleep1 * 1000); #else sleep(sleep1); #endif cout<<" :YYYYYYYYYYYYYYYYYYYYYYYYJJJJJJYYYYYYYYYYYYYYYYYYYYYYYY: "<<endl;} //Draw Logo void logo(){ cout<<" __ __ _______ _______ _______ ___ "<<endl; cout<<" | | | || || || || | "<<endl; cout<<" | |_| || _ ||_ _|| ___|| | "<<endl; cout<<" | || | | | | | | |___ | | "<<endl; cout<<" | || |_| | | | | ___|| |___ "<<endl; cout<<" | _ || | | | | |___ | |"<<endl; cout<<" |__| |__||_______| |___| |_______||_______|"<<endl; cout<<" "<<endl; cout<<" "<<endl; cout<<" "<<endl; } //Emplo Struct struct Emplo { int id; string name; string gender; int age; int phone; float salary; string address; string department; }; //Guest Struct struct Guest { int id; string name; int age; string address; string phone; }; //Room Struct struct Room { int number; // رقم الغرفة int capacity; // سعة الغرفة bool isBooked; // حالة حجز الغرفة float price; //سعر الغرفه }; struct Reserve_rooms{ int Guest_id; int Room_Num; int nights; }; void main() { //color console HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, 11); //intro animation Intro(); //----------------------------------------Main Menu Code----------------------------------------- Main_Menu: clear_console(); logo(); int choice; //----------------------------------------Print Choices----------------------------------------- cout << " +----------+----------+" << endl; cout << " | 1- Employees |" << endl; cout << " +----------+----------+" << endl; cout << " | 2- Guests |" << endl; cout << " +----------+----------+" << endl; cout << " | 3- Rooms |" << endl; cout << " +----------+----------+" << endl; cout << " | 4- Reserve Rooms |" << endl; cout << " +----------+----------+" << endl; cout << " | 5- EXIT |" << endl; cout << " +----------+----------+" << endl; cout<<" >> "; //----------------------------------------Choices Code----------------------------------------- cin>>choice; //----------------------------------------------------1------------------------------------------------- if(choice == 1){Employees: //----------------------------------------Employees Choice Code----------------------------------------- clear_console(); logo(); int Employees; cout << " +-----------+-----------+" << endl; cout << " | 1- Add Employee |" << endl; cout << " +-----------+-----------+" << endl; cout << " | 2- Search For Employee|" << endl; cout << " +-----------+-----------+" << endl; cout << " | 3- Main Menu |" << endl; cout << " +-----------+-----------+" << endl; cout<<" >> "; cin>>Employees; if(Employees == 1) goto Employees_Add; else if(Employees == 2) goto Employees_Search; else if(Employees == 3) goto Main_Menu; } //----------------------------------------------------2------------------------------------------------- if(choice == 2){ //----------------------------------------Guests Choice Code----------------------------------------- Guests: clear_console(); logo(); int Guests; cout << " +-----------+-----------+" << endl; cout << " | 1- Add Guest |" << endl; cout << " +-----------+-----------+" << endl; cout << " | 2- Search For Guest |" << endl; cout << " +-----------+-----------+" << endl; cout << " | 3- Main Menu |" << endl; cout << " +-----------+-----------+" << endl; cout<<" >> "; cin>>Guests; if(Guests == 1) goto Guests_Add; else if(Guests == 2) goto Guests_Search; else if(Guests == 3) goto Main_Menu; } //------------------------------------------------3------------------------------------------------- if(choice == 3){ //----------------------------------------Rooms Choice Code----------------------------------------- Rooms: clear_console(); logo(); int Rooms; cout << " +-----------+-----------+" << endl; cout << " | 1- Add Room |" << endl; cout << " +-----------+-----------+" << endl; cout << " | 2- Search For Room |" << endl; cout << " +-----------+-----------+" << endl; cout << " | 3- Main Menu |" << endl; cout << " +-----------+-----------+" << endl; cout<<" >> "; cin>>Rooms; if(Rooms == 1) goto Rooms_Add; else if(Rooms == 2) goto Rooms_Search; else if(Rooms == 3) goto Main_Menu; } //------------------------------------------------4------------------------------------------------ //-----------------------------------------Reserve Rooms----------------------------------------- else if(choice == 4) goto Reserve; //------------------------------------------------5------------------------------------------------ //----------------------------------------EXIT Choice Code----------------------------------------- else if(choice == 5) exit(0); else cout<<" Wrong Choice"<<endl; #ifdef _WIN32 Sleep(1 * 1000); #else sleep(1); #endif goto Employees; goto Main_Menu; //----------------------------------------1- If Choose Employees----------------------------------- //----------------------------------------If Choose Employees Add---------------------------------- Employees_Add: clear_console(); logo(); int M; cout << "Enter Number Of Employees: "; cin >> M; Emplo* emplo = new Emplo[M]; for (int i = 0; i < M; i++) { cout << "\nEnter the details of Employees " << endl; cout << "ID: "; cin >> emplo[i].id; cout << "Name: "; cin >> emplo[i].name; cout << "Age: "; cin >> emplo[i].age; cout << "Address: "; cin >> emplo[i].address; cout << "Phone number: "; cin >> emplo[i].phone; cout << "Gender: "; cin >> emplo[i].gender; cout << "Department : "; cin >> emplo[i].department; cout << "Salary: "; cin >> emplo[i].salary; } goto Employees; //----------------------------------------If Choose Employees Search--------------------------------- Employees_Search: clear_console(); logo(); int E_search_id; cout << "\nEnter the ID to view details: "; cin >> E_search_id; bool E_found = false; for (int N = 0; N < M; N++) { if (emplo[N].id == E_search_id) { E_found = true; cout << "\nDetails of Emplooyes with ID " << E_search_id << endl; cout << "Name: " << emplo[N].name << endl; cout << "Age: " << emplo[N].age << endl; cout << "Address: " << emplo[N].address << endl; cout << "Phone number: " << emplo[N].phone << endl; cout << "Department: " << emplo[N].department << endl; cout << "Gender: " << emplo[N].gender << endl; cout << "Salary: " << emplo[N].salary << endl; break; } goto Employees; //----------------------------------------2- If Choose Rooms----------------------------------------- //----------------------------------------If Choose Rooms Add---------------------------------------- Rooms_Add: clear_console(); logo(); int x; cout << "Enter Number Of Rooms: "; cin >> x; Room* room2= new Room[x]; for (int i = 0; i < x; i++) { cout << "\nEnter the details of Rooms " << endl; cout << "Room Number : "; cin >> room2[i].number; cout << "capacity : "; cin >> room2[i].capacity; cout << "booking status : "; cin >> room2[i].isBooked; cout << "Price Of The Room Per Night : "; cin >> room2[i].price; } goto Rooms; //----------------------------------------If Choose Rooms Search------------------------------------- Rooms_Search: clear_console(); logo(); int R_search_id; cout << "\nEnter the Room Number to view details: "; cin >> R_search_id; bool R_found = false; for (int a = 0; a < x; a++) { if (room2[a].number == R_search_id) { R_found = true; cout << "\nDetails of Room with Room Number " << R_search_id << endl; cout << "Room Number : " << room2[a].number << endl; cout << "capacity : " << room2[a].capacity << endl; cout << "booking status : " << room2[a].isBooked << endl; cout << "Room price : " << room2[a].price << endl; break; } } if(!R_found) { cout << "No Room found with ID " << R_search_id << endl; } string ch_R; cout<<"Do You Want To Search For Another: "; cin>>ch_R; if(ch_R == "YES" || ch_R == "Y" || ch_R == "yes" || ch_R == "y") goto Rooms_Search; else goto Rooms; } goto Rooms; //----------------------------------------3- If Choose Guests----------------------------------------- //----------------------------------------If Choose Guests Add----------------------------------------- Guests_Add: clear_console(); logo(); int n; cout<<"Enter Number Of Guests: "; cin>>n; Guest* guest = new Guest[n]; for(int i=0; i<n; i++) { cout << "\nEnter the details of Guest "<< endl; cout << "Name: "; cin >> guest[i].name; cout << "Age: "; cin >> guest[i].age; cout << "Address: "; cin >> guest[i].address; cout << "Phone number: "; cin >> guest[i].phone; cout << "ID: "; cin >> guest[i].id; } goto Guests; //---------------------------------------------------------------------------------------------------------- //----------------------------------------If Choose Guests Search----------------------------------------- Guests_Search: clear_console(); logo(); //----------------------------------------Retrieving the Guest details using ID--------------------------- int C_search_id; cout << "\nEnter the ID to view details: "; cin >> C_search_id; bool C_found = false; for(int i=0; i<n; i++) { if(guest[i].id == C_search_id) { C_found = true; cout << "\nDetails of Guest with ID " << C_search_id << endl; cout << "Name: " << guest[i].name << endl; cout << "Age: " << guest[i].age << endl; cout << "Address: " << guest[i].address << endl; cout << "Phone number: " << guest[i].phone << endl; break; } } if(!C_found) { cout << "No Guest found with ID " << C_search_id << endl; #ifdef _WIN32 Sleep(1 * 1000); #else sleep(1); #endif }else{ string ch1; cout<<"Do You Want To Search For Another: "; cin>>ch1; if(ch1 == "YES" || ch1 == "Y" || ch1 == "yes" || ch1 == "y") goto Guests_Search; }goto Guests; //----------------------------------------3- If Choose Guests----------------------------------------- //----------------------------------------If Choose Guests Add----------------------------------------- Reserve: clear_console(); logo(); int R; cout << "Enter Number Of Rooms: "; cin >> R; bool R_G_found = false; bool R_R_found = false; Reserve_rooms* reserve = new Reserve_rooms[R]; for (int i = 0; i < R; i++) { cout << "Guest ID : "; cin >> reserve[i].Guest_id; for(int i=0; i<R; i++) { if(guest[i].id == reserve[i].Guest_id) { R_G_found = true; break; } else if(!R_G_found) { cout << "No Guest found with ID " << reserve[i].Guest_id << endl; #ifdef _WIN32 Sleep(1 * 1000); #else sleep(1); #endif goto Reserve; } } cout << "Room Number : "; cin >> reserve[i].Room_Num; for (int a = 0; a < R; a++) { if(room2[a].number == reserve[i].Room_Num) { R_R_found = true; } cout << "Number Of Nights : "; cin >> reserve[i].nights; goto Main_Menu; } } }
Editor is loading...