Hotel Project

 avatar
unknown
c_cpp
2 years ago
14 kB
19
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;




}
	//Customer Struct
struct Customer {
    string name;
    int age;
    string address;
    string phone;
    int id;
};

void main() {
	
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	
	//color console
	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- Customers     |" << endl;
		cout << "                                +----------+----------+" << endl;
		cout << "                                |     3- Rooms        |" << endl;
		cout << "                                +----------+----------+" << endl;
		cout << "                                |     4- 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){
//----------------------------------------Customers Choice Code-----------------------------------------
Customers:

		clear_console();
		logo();
		int Customers;

		cout << "                                +-----------+-----------+" << endl;
		cout << "                                |     1- Add Customer   |" << endl;
		cout << "                                +-----------+-----------+" << endl;
		cout << "                                | 2- Search For Customer|" << endl;
		cout << "                                +-----------+-----------+" << endl;
		cout << "                                |      3- Main Menu     |" << endl;
		cout << "                                +-----------+-----------+" << endl;
		cout<<"                                        >> ";

		cin>>Customers;
		if(Customers == 1)
			goto Customers_Add;
		else if(Customers == 2)
			goto Customers_Search;
		else if(Customers == 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------------------------------------------------
//----------------------------------------EXIT Choice Code-----------------------------------------
	else if(choice == 4)
			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:
	cout<<"Not Ready Yet"<<endl;
	#ifdef _WIN32
    Sleep(1 * 1000);
    #else
    sleep(1);
    #endif
	goto Employees;




//----------------------------------------If Choose Employees Search---------------------------------	

	Employees_Search:
	cout<<"Not Ready Yet"<<endl;
		#ifdef _WIN32
    Sleep(1 * 1000);
    #else
    sleep(1);
    #endif
	goto Employees;



//----------------------------------------2- If Choose Rooms-----------------------------------------

//----------------------------------------If Choose Rooms Add----------------------------------------	
	Rooms_Add:
	cout<<"Not Ready Yet"<<endl;
	#ifdef _WIN32
    Sleep(1 * 1000);
    #else
    sleep(1);
    #endif
	goto Rooms;

//----------------------------------------If Choose Rooms Search-------------------------------------	

	Rooms_Search:
	cout<<"Not Ready Yet"<<endl;
	#ifdef _WIN32
    Sleep(1 * 1000);
    #else
    sleep(1);
    #endif
	goto Rooms;



//----------------------------------------3- If Choose Customers-----------------------------------------

//----------------------------------------If Choose Customers Add-----------------------------------------	


Customers_Add:
		  clear_console();
		  logo();


	int n;
	cout<<"Enter Number Of Customers: ";
	cin>>n;
   Customer* customer = new Customer[n];
    for(int i=0; i<n; i++) {
        cout << "\nEnter the details of Customer "<< endl;
        cout << "Name: ";
        cin >> customer[i].name;
        cout << "Age: ";
        cin >> customer[i].age;
        cout << "Address: ";
        cin >> customer[i].address;
        cout << "Phone number: ";
        cin >> customer[i].phone;
        cout << "ID: ";
        cin >> customer[i].id;

    }
	goto Customers;

//----------------------------------------------------------------------------------------------------------


//----------------------------------------If Choose Customers Search-----------------------------------------	

Customers_Search:
			clear_console();
			logo();         
//----------------------------------------Retrieving the Customer details using ID---------------------------	

    int search_id;
    cout << "\nEnter the ID to view details: ";
    cin >> search_id;
    
    bool found = false;
    for(int i=0; i<n; i++) {
        if(customer[i].id == search_id) {
            found = true;
            cout << "\nDetails of Customer with ID " << search_id << endl;
            cout << "Name: " << customer[i].name << endl;
            cout << "Age: " << customer[i].age << endl;
            cout << "Address: " << customer[i].address << endl;
            cout << "Phone number: " << customer[i].phone << endl;
            break;
        }
    }
    
    if(!found) {
        cout << "No Customer found with ID " << search_id << endl;
    }
	string ch1;
	cout<<"Do You Want To Search For Another: ";
    cin>>ch1;
	if(ch1 == "YES" || ch1 == "Y" || ch1 == "yes" || ch1 == "y")
		goto Customers_Search;
	else
		goto Customers;
}
Editor is loading...