Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <iomanip>
- using namespace std;
- void guestreser();
- void reservation();
- struct Guest {
- string name;
- string surname;
- int ID;
- string country;
- string date;
- void guestreser();
- };
- void guestreser()
- {
- Guest guest1;
- char choice;
- cout << "Enter your Name:";
- cin >> guest1.name << endl;
- cout << "Enter your Surname";
- cin >> guest1.surname << endl;
- cout << "Enter your ID no: ";
- cin >> guest1.ID << endl;
- cout << "Which country are u coming from:";
- cin >> guest1.country << endl;
- }
- struct hotel_info {
- string stars;
- string free_offers;
- int price;
- };
- struct hotel {
- string name;
- string country;
- hotel_info facilities;
- string roomoffers;
- void printhotel()
- {
- hotel h;
- cout << "Informations related to hotel:" << endl;
- cout << "|--------------------------------------------------------------------------------------------------------------------|" << endl;
- cout << setw(8) << "Hotel's name";
- cout << setw(13) << "Hotel's location";
- cout << setw(16) << "Hotel's facilities";
- cout << setw(20) << "Hotel's room" << endl;
- cout << "|---------------------------------------------------------------------------------------------------------------------|" << endl;
- for (int i = 0; i < 10; i++)
- {
- cout << setw(3) << "|" << setw(6) << h.name;
- cout << setw(13) << h.country;
- cout << setw(16) << h.facilities.stars;
- cout << setw(16) << h.facilities.free_offers;
- cout << setw(20) << h.facilites.roomoffers << "|" << endl;
- }
- }
- cout << "|----------------------------------------------------------------------------------------------------------------------|" << endl;
- };
- int main()
- {
- hotel resort;
- int x;
- resort.name = {" Alhambra Hotel" };
- resort.country = { "Egypt" };
- resort.facilities.stars = { 5 };
- resort.facilities.free_offers = { "Free parking","Free Wi-fi","Free breakfast","Airport transfer" };
- resort.facilities.roomoffers = { "Single Room","Double Room","Queen Room" };
- cout << endl;
- cout << " / \ " << endl;
- cout << " // \\ " << endl;
- cout << " /// Welcome to the Alhambra Hotel's Reservation Programe\\\ " << endl;
- cout << " \\ //" << endl;
- cout << " \ / " << endl;
- cout << endl;
- for (int i = 0; i < 10; i++)
- {
- cout << "Press 1 for more information about the hotel" << endl;
- cout << endl;
- cout << "Press 2 for booking a room!" << endl;
- cout << endl;
- cout << "Press 3 to exit the programe" << endl;
- cout << endl;
- cout << "Enter Here:"cin >> x;
- switch (x)
- {
- case 1:
- resort.printhotel();
- break;
- case 2:
- reservation();
- break;
- case 3:
- break;
- }
- }
- Guest g1;
- g1.guestreser();
- Hotel h1;
- h1.
- cin.get(); cin.get();
- return 0;
- }
- void reservation()
- {
- int days, choice, price1,price2,price3;
- char repeat;
- int a = 1000;
- int single = 250;
- int double = 500;
- int queen = 1000;
- do {
- cout << "What type of room do you choose?" << endl;
- cout << endl;
- cout << "1.Single Room" << endl;
- cout << endl;
- cout << "2.Double Room" << endl;
- cout << endl;
- cout << "3.Queen Room" << endl;
- cout << endl;
- cout << "Enter your choice__:"endl;
- cout << endl;
- cin >> choice;
- switch (choice)
- {
- case 1:
- cout << "Single Room." << endl;
- cout << endl;
- cout << "How many days are you staying:" << endl;
- cin >> days << endl;
- price1 = a * single * days;
- cout << "The total price is " << price1 << endl;
- break;
- case 2:
- cout << "Double Room" << endl;
- cout << endl;
- cout << "How many days are you staying:" << endl;
- cin >> days << endl;
- price2 = a * double* days;
- cout << "The total is going to be:" << price2 << endl;
- break;
- case 3:
- cout << "Queen Room" << endl;
- cout << endl;
- cout << "How many days are you staying:" << endl;
- cin >> days << endl;
- price3 = a * queen* days;
- cout << "The total is going to be:" << price3 << endl;
- break;
- default:
- cout << "Wrong Choice" << endl;
- cout << endl;
- }
- cout << "For checking another room press 'J' :";
- cin >> repeat;
- cout << endl;
- } while (repeat == 'J' || repeat == 'j');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement