Question

In: Computer Science

using c++ You have been contracted to build a hotel reservation system. This is the system...

using c++ You have been contracted to build a hotel reservation system. This is the system that hotel desk clerks will use to take desk reservations.

Assumptions: This is acting as though the only reservations taken are at the desk. All reservations are for one night. The hotel is empty when you start the program.

First, this program will give the full inventory of rooms in the hotel.

Total rooms: 122

There are four types of rooms with these prices:

  • Standard Rooms, Courtyard - 70 - $125 a night
  • Standard Room, Scenic - 35 - $145 a night
  • Deluxe Suite - 15 - $350 a night
  • Penthouse - 2 - $1135 a nigh

    Second, the program will allow for a room to be reserved for one night. The program will keep track of the inventory as rooms are being reserved.

    Third, the program will keep track of revenue brought in for the day from reserved rooms.

    Fourth, the user can choose a getTotal() function that will display remaining room inventory, what was reserved and revenue generated for the day.

  • PLEASE NOTE: This project must incorporate a class friend or class inheritance structure.

Solutions

Expert Solution

#include<iostream>
using namespace std;
class hotel
{
    public:
    int totalrooms=112;
    int Standard_Rooms_Courtyard = 70;
    int Standard_Room_Scenic = 35;
    int Deluxe_Suite = 15;
    int Penthouse = 2;
    
    void getTotal()
    {
        cout<<totalrooms<<": Total remaining rooms\n"<<Standard_Rooms_Courtyard
        <<": Standard_Rooms_Courtyard \n"<<Standard_Room_Scenic<<": Standard_Room_Scenic \n"
        <<Deluxe_Suite<<": Deluxe_Suite \n"<<Penthouse<<": Penthouse\n";
    }
};
class price : public hotel
{
    public:
    float Standard_Rooms_Courtyard = 125;
    float Standard_Room_Scenic = 145;
    float Deluxe_Suite = 350;
    float Penthouse = 1135;
    float netprice=0;
    
    void getTotal()
    {
        cout<<"\nnetprice: "<<netprice;
    }
    void booking()
    {
        cout<<"\nPlease enter your choice\n1. Standard Rooms, Courtyard - 70 - $125 a night\n2. Standard Room, Scenic - 35 - $145 a night\n3. Deluxe Suite - 15 - $350 a night\n4. Penthouse - 2 - $1135 a night\n";
        int choice;
        booking:
        cin>>choice;
        switch(choice)
        {
            case 1:hotel::Standard_Rooms_Courtyard--;
            netprice+=Standard_Rooms_Courtyard;
            hotel::totalrooms--;
            break;
            case 2:hotel::Standard_Room_Scenic--;
            netprice+=Standard_Room_Scenic;
            hotel::totalrooms--;
            break;
            case 3:hotel::Deluxe_Suite--;
            netprice+=Deluxe_Suite;
            hotel::totalrooms--;
            break;
            case 4:hotel::Penthouse--;
            netprice+=Penthouse;
            hotel::totalrooms--;
            break;
            default :cout<<"\nthat was a wrong choice\nplease try again\n";
            goto booking;
            break;
        }
    }
    
};
int main()
{
    price p;
    start:
    cout<<"\nPlease select you choice\n";
    cout<<"\n1. Hotel booking\n2. total remaining rooms\n3. netprice\n0. Exit";
    int choice;
    cin>>choice;
    switch(choice)
    {
        case 0:break;
        case 1:p.booking();
        goto start;
        break;
        case 2:p.hotel::getTotal();
        goto start;
        break;
        case 3:p.getTotal();
        goto start;
        break;
        default :cout<<"\nthat was a wrong choice\nplease try again\n";
        goto start;
        break;
    }
}

I hope it helps.


Related Solutions

Tema Container Terminal (TCT) plans to build a new container terminal. You have been contracted to...
Tema Container Terminal (TCT) plans to build a new container terminal. You have been contracted to determine the land area for the new terminal. Explain the factors you will consider and how these factors will affect the land area for the terminal
Tema Container Terminal (TCT) plans to build a new container terminal. You have been contracted to...
Tema Container Terminal (TCT) plans to build a new container terminal. You have been contracted to determine the land area for the new terminal. Explain the factors you will consider and how these factors will affect the land area for the terminal.
bus reservation system code using c language in this system we can add seat and remove....
bus reservation system code using c language in this system we can add seat and remove. this code will be in c language using 2 d aray
Create a Database Schema for a hotel reservation system. indicate the Primary Keys, Foreign Keys, and...
Create a Database Schema for a hotel reservation system. indicate the Primary Keys, Foreign Keys, and the one-to-one or one-to-many relationships between the tables. Also describe in a small paragraph the scope of the back-end database, by explaining the different tables and their relations in your schema.
You have been appointed as the new general manager of a named hotel. The hotel is...
You have been appointed as the new general manager of a named hotel. The hotel is not performing as expected and is not meeting its target. Your first assignment is to resolve this problem. Describe in details how you would go about addressing this problem. Hint: Describe the data collection approaches you would use (Observation, interviews, surveys, historical research (past 5 years), etc.) and why you chose this specific form of data collection etc.
Write a program for hotel booking system using C++ Program Requirement 1. You can write any...
Write a program for hotel booking system using C++ Program Requirement 1. You can write any program based on the title assigned. 2. The program must fulfill ALL the requirements below. The requirements listed below are the MINIMUM requirement. Your program may extend beyond the requirements if needed. a) Create at least one (1) base class. b) Create at least two (2) derived classes that inherit from the base class created in 2(a). c) Create at least one (1) object...
Build a conceptional model for a Hotel Management System. The solution should be presented as an...
Build a conceptional model for a Hotel Management System. The solution should be presented as an ER-diagram. Base your design on the following requirements. • The database should record information about Customer, Hotel, Booking, Rooms, Employee, Feedback, and Payments. • A Customer has a name which consists of firstName, middleName and lastName. Customers are identified by a unique customerID. A Customer has an Address, phoneNo and email address – Customers can place any number of Bookings (including none). Customer may...
You have been contracted by the government of your country to provide recommendations on the regulation...
You have been contracted by the government of your country to provide recommendations on the regulation of the national textile industry. Currently, the textile industry which resembles features of the perfectly competitive market is completely unregulated. Using the concepts covered in the class, please provide your advice to the problems below. One of the biggest social problems in the textile industry is child labour which, among other things, reduces school attendance. The government is considering two types of interventions and...
You have been contracted by the City of Sydney Council to inspect an issue that has...
You have been contracted by the City of Sydney Council to inspect an issue that has been reported by residents living in a western suburb. The residents claim that one of the roads in their suburb has lately had issues with traffic speeding. The City of Sydney Council wants you to investigate if traffic speeding is an issue and, if this is the case, they will invest in building asphalt speed bumps to enforce reduced traffic speeds on that particular...
You have been contracted by a triathlete to determine their maximal aerobic capacity. As the athlete...
You have been contracted by a triathlete to determine their maximal aerobic capacity. As the athlete arrived at your laboratory, you realized that your metabolic chart had stopped functioning, and you need to measure blood gasses to perform the test. The data you obtain are as follow: -Age: 35 years old -Height: 1.75m -Weight: 73kg -Speed at VO2max: 16.2 km/h -Heart Rate at VO2max: 192 bpm -End Diastolic Volume: 242mL -End Systolic Volume: 90mL -Hemoglobin concentration: 163g/L (16.3 g/100mL) -Arterial...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT