Question

In: Computer Science

Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double...

Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double room: $75/night King room: $100/night Suite room: $150/night The size of the hotel chains in different locations may be different in terms of the number of floors and the type and the number of rooms on each floor. You are required to write a program that calculates the occupancy rate and the total hotel income for one night and displays this information as well as some other information described below. The program starts by asking the location where this hotel chain is located and the number of floors in the hotel. The number of floors may not exceed 5. The User then enters the total number of rooms for each floor. The program then asks specifically the number of occupied rooms for each room type on this floor. The total number of rooms on each floor may not exceed 30 and the program should check that the total number of occupied rooms on each floor does not exceed the total of rooms on that floor. After the information is entered for each floor, the program calculates the following: - Hotel income (based on the room type and its rate), - The total number of occupied rooms, - Total number of the uncopied rooms, - The rate of occupancy, - Floor number with the minimum number of rooms. (Assume no two floors have the same number of rooms). - A message to improve the occupancy rate for the occupancy rate of less than 60%. - Programmer’s full name - Project number - Project due date Project Specifications -Use constant variables to hold room rates, max and min # of floors and rooms. -The program should continuously ask for the correct floor number if it is not within the range of 1 and 5. -The program should continuously ask for the correct number of rooms for each floor if it is not within the range of 1 and 30. -The program should repeat the process of asking the number of rooms on the floor and number of occupied rooms if the total number of occupied rooms exceeds the total number of rooms on the floor. Refer to Sample outputs for more clarification.

Solutions

Expert Solution

Program Screenshot:

Sample output 1:

Sample output 2:

Sample output 3:

Code to copy:

#include <iostream>

#include <string>

#include <iomanip>

using namespace std;

int main()

{

       // declare variables

       string location;

       int i, floors, rooms[30], singleRoom[10], doubleRoom[10], king[10], suite[10];

       //initailze the values for four different rooms

       int singleRRate = 60, doubleRRate = 75, kingRRate = 100, stroom = 150;

       int unoccupied, min;

       double totalRooms = 0, occupied_rooms = 0, income = 0.0, occupancy_rate;

       int sum = 0;

       cout << fixed << setprecision(2);

       cout << "----------------------------------------------------\n";

       cout << right << setw(30) << "BlueMount Hotel\n";

       cout << "----------------------------------------------------\n";

       //prompt and read the location where this hotel chain is located.

       cout << "Enter the Location of this hotel chain: ";

       cin >> location;

       //prompt and read the number of floors in the hotel.

       cout << "Enter total number of floors of the hotel: ";

       cin >> floors;

       // The number of floors may not exceed 5.

       //continuously ask for the correct floor number if it is not within the range of 1 and 5.

       while (floors<=0 || floors>5)

       {

              cout << "number of floors should be between 1 and 5 !! please try again.\n";

              cout << "\nEnter total number of floors of the hotel: ";

              cin >> floors;

       }

       // iterate a loop to read the total number of rooms for each floor.

       for (i = 1; i <= floors; i++)

       {

              cout << "\n\nEnter total number of rooms in the " << i << "th floor: ";

              cin >> rooms[i];

              //The total number of rooms on each floor may not exceed 30.

              // continuously ask for the correct number of rooms within the range of 1 and 30.

              while (rooms[i] <= 0 || rooms[i]>30)

              {

                     cout << "number of rooms should be between 1 and 30 !! please try again.\n\n";

                     cout << "Enter total number of rooms in the " << i << "th floor : ";

                     cin >> rooms[i];

              }

              //prompt and read the number of occupied rooms for each room type on this floor.

              cout << "How many SINGLE rooms are occupied in the " << i << "th floor : ";

              cin >> singleRoom[i];

              cout << "How many DOUBLE rooms are occupied in the " << i << "th floor : ";

              cin >> doubleRoom[i];

              cout << "How many KING rooms are occupied in the " << i << "th floor : ";

              cin >> king[i];

              cout << "How many SUITE rooms are occupied in the " << i << "th floor : ";

              cin >> suite[i];

              sum = singleRoom[i] + doubleRoom[i] + king[i] + suite[i];

              //check that the total number of occupied rooms on each floor

              //does not exceed the total of rooms on that floor.

              while(sum > rooms[i])

              {

                     cout << "Total number of occupied rooms exceeds the total number of "

                           <<"rooms on this floor. Please try again!!";

                     sum = 0;

                     cout << "\n\nEnter total number of rooms in the " << i << "th floor : ";

                     cin >> rooms[i];

                     while (rooms[i] <= 0 || rooms[i]>30)

                     {

                           cout << "number of rooms should be between 1 and 30 !! please try again.\n\n";

                           cout << "Enter total number of rooms in the " << i << "th floor : ";

                           cin >> rooms[i];

                     }

                     cout << "How many SINGLE rooms are occupied in the " << i << "th floor : ";

                     cin >> singleRoom[i];

                     cout << "How many DOUBLE rooms are occupied in the " << i << "th floor : ";

                     cin >> doubleRoom[i];

                     cout << "How many KING rooms are occupied in the " << i << "th floor : ";

                     cin >> king[i];

                     cout << "How many SUITE rooms are occupied in the " << i << "th floor : ";

                     cin >> suite[i];

                     sum = singleRoom[i] + doubleRoom[i] + king[i] + suite[i];

              }

       }

       //print the information of the rates of room types

       cout << "\n\n-------------------------------------------------------------------------------\n";

       cout << right << setw(40) << "BlueMont Hotel located in " << location << endl << endl;

       cout << right << setw(47) << "TODAY'S ROOM RATES<US$/night>" << endl << endl;

       cout << right << setw(20) << "Single Room"<< setw(20) << "Double Room"<<setw(20)

              << "King Room"<< setw(20) << "Suite Room";

       cout << endl<<endl;

       cout << right << setw(20) << singleRRate << setw(20) << doubleRRate << setw(20)

              << kingRRate << setw(20) << stroom;

       cout << "\n-------------------------------------------------------------------------------\n";

       for (i = 1; i <= floors; i++)

       {

              //calculate hotel income based on the room type and its rate.

              income = income + (singleRoom[i] * singleRRate) +

                     (doubleRoom[i] * doubleRRate) + (king[i] * kingRRate) + (suite[i] * stroom);

              //The total number of rooms.

              totalRooms = totalRooms + rooms[i];

              //The total number of occupied rooms.

              occupied_rooms = occupied_rooms + singleRoom[i] + doubleRoom[i] + king[i] + suite[i];

       }

       //The total number of unoccupied rooms.

       unoccupied = totalRooms - occupied_rooms;

       //The rate of occupancy

       occupancy_rate = (occupied_rooms / totalRooms) * 100;

       // print the data

       cout << "\n" << right << setw(35) << "Hotel Income: " << right << setw(10) << "$" << income;

       cout << "\n" << right << setw(35) << "Total # of rooms: " << right << setw(10) << totalRooms;

       cout << "\n" << right << setw(35) << "Total # Occupied Rooms: " << right << setw(10) << occupied_rooms;

       cout << "\n" << right << setw(35) << "Total # Unoccupied Rooms: " << right << setw(10) << unoccupied;

       cout << "\n" << right << setw(35) << "Occupancy rate: " << right << setw(10) << occupancy_rate << "%";

       //find the Floor number with the minimum number of rooms.

       int r = 1;

       min = rooms[1];

       for (i = 2; i <= floors; i++)

       {

              if (rooms[i] < min)

              {

                     min = i;

                     r = i;

              }            

       }

       // display as required

       cout << "\n\n" << r << "th Floor with " << rooms[r] << " rooms, has the least # of rooms.";

       //if the occupancy rate is less than 60%, then print a message.

       if (occupancy_rate < 60)

       {

              cout << "\nNeed to improve Hotel occupancy rate!!\n\n";

       }

       cout << "\n\nThank you for testing my program!!";

       cout << "\nPROGRAMEER : YOUR NAME";

       cout << "\nCMSC140 Common Project 3";

       cout << "\nDue Date: PROJECT DUE DATE\n\n";

       //system("pause");

       return 0;

}


Related Solutions

Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double...
Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double room: $75/night King room:   $100/night Suite room: $150/night The size of the hotel chains in different locations may be different in terms of the number of floors and the type and the number of rooms on each floor. You are required to write a program that calculates the occupancy rate and the total hotel income for one night and displays this information as well...
Listed below are prices in dollars for one night at different hotels in a certain region....
Listed below are prices in dollars for one night at different hotels in a certain region. Find the​ range, variance, and standard deviation for the given sample data. Include appropriate units in the results. How useful are the measures of variation for someone searching for a​ room? 270 278 154 144 220 222 178 285
Listed below are prices in dollars for one night at different hotels in a certain region....
Listed below are prices in dollars for one night at different hotels in a certain region. Find the range, variance, and standard deviation for the given sample data. Include appropriate units in the results. How useful are the measures of variation for someone searching for a room? 249, 144, 192, 80, 148, 260, 256, 105 Use correct units in your responses. The range of the sample data is ______________________ . The standard deviation of the sample data is ________________________. The...
A hotel has 200 rooms and charges two different room rates: rL =$100/ night for...
A hotel has 200 rooms and charges two different room rates: rL = $100/ night for discount fares and rH = $500/ night targeting business travelers. Demand for the discounted rooms exceeds the 200 room hotel capacity.A. What is the Co (overage cost), in $?B.What is the Cu, underage cost, in $?C. What is the critical ratio (round to two digits)?D. Assuming the demand for high fare rooms has a Normal distribution with mean =50 and standard deviation =15, how...
List and discuss the four ( 4) different "values" that a single property can have.
List and discuss the four ( 4) different "values" that a single property can have.
The management of 50-room Gordion Hotel, which has single and double rooms only, has acquired the...
The management of 50-room Gordion Hotel, which has single and double rooms only, has acquired the following internal financial data: • Occupancy of 65.00% • Projected after-tax average daily room rate (ADR) of $54.00 • 25.00% of double room occupancy • A price difference of $15.00 more for double rooms than the singles Based on the financial information given, calculate the individual ADRs for single and double rooms for Gordion. The operation team of H hotel, which has 25 rooms...
How is the concept of resort hotel different from other types of hotels? From a manager’s...
How is the concept of resort hotel different from other types of hotels? From a manager’s perspective, how is managing a resort hotel different from running other properties?
4. a. we learned about 4 different types of membrane cell receptors. describe these different types...
4. a. we learned about 4 different types of membrane cell receptors. describe these different types and give a spesific example for each of them. b. a certain patient as a mutation that nutrelizes the enzyme that is incharge of Myristoylation of proteins. which of the types of receptors that you descibed in question a will be affected by this mutation? what will be the effect? what is the role of Myristoylation? give as much details as possible.
Terwilliger Corporation owns a number of cruise ships and a chain of hotels. The hotels, which have not been profitable, were discontinued on September 1, 2017.
Terwilliger Corporation owns a number of cruise ships and a chain of hotels. The hotels, which have not been profitable, were discontinued on September 1, 2017. The 2017 operating results for the company were as follows. Operating revenues...................................$12,850,000 Operating expenses.......................................8,700,000 Operating income........................................$ 4,150,000   Analysis discloses that these data include the operating results of the hotel chain, which were operating revenues $1,500,000 and operating expenses $2,400,000. The hotels were sold at a gain of $200,000 before taxes. This gain is...
Certain single-site catalyst are capable of selectively forming different types of polypropylene. Describe these different types...
Certain single-site catalyst are capable of selectively forming different types of polypropylene. Describe these different types of polymer, and the characteristics of the catalysts that form them.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT