Question

**Use C++ ** Project Description The BlueMont chain hotels have 4 different types of room: Single...

**Use C++ **

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Check out the solution and let me know if you have any queries through COMMENTS.

____________

#include <iostream>

#include <string>

#include <iomanip>

using namespace std;

int main() {

// declare required variables

string location;

int i, floors, rooms[30], single[10], doublee[10], king[10], suite[10];

int sroom = 60, droom = 75, kroom = 100, stroom = 150, unoccupied_rooms, min;

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

cout << fixed << setprecision(2);

// display as required

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

cout << "\t\t\tBlueMount Hotel\n";

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

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

cin >> location;

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

cin >> floors;

// if floors exceeds 5 then exit from the program by printing necessary message

if (floors > 5)

{

cout << "\n Number of floors cannot exceed 5";

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

cout << "\n\nPROGRAMEER : YOUR NAME";

cout << "\nCMSC140 Common Project 3";

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

exit(1);

}

// loop through each floor asking the input from user

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

{

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

cin >> rooms[i];

// if rooms exceeds 30 then exit from the program by printing necessary message

if (rooms[i] > 30)

{

cout << "\n Number of rooms cannot exceed 30";

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

cout << "\n\nPROGRAMEER : YOUR NAME";

cout << "\nCMSC140 Common Project 3";

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

exit(1);

}

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

cin >> single[i];

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

cin >> doublee[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];

} // for ends

// display as required

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

cout << "\n\t\t\tBlueMont Hotel located in "<<location;

cout << "\n\n\t\t\t\tTODAY'S ROOM RATES(US$/night)";

cout << "\n\n\t\tSingle Room\t\tDouble Room\t\tKing Room\t\tSuite Room";

cout << "\n\t\t\t\t" << sroom << "\t\t\t\t" << droom << "\t\t\t\t" << kroom << "\t\t\t\t" << stroom;

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

// calculations part

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

{

income = income + (single[i]*sroom) + (doublee[i]*droom) + (king[i]*kroom) + (suite[i]*stroom);

num_rooms = num_rooms + rooms[i];

occupied_rooms = occupied_rooms + single[i] + doublee[i] + king[i] + suite[i];

}

unoccupied_rooms = num_rooms - occupied_rooms;

occupancy_rate = (occupied_rooms / num_rooms) * 100;

// display the calculated variables and align properly using setw()

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

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

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

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

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

// find the minimum numer of floors

// i represents the floor number

min = rooms[1];

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

{

if(rooms[i] < min)

min = i;

}

// display as required

cout << "\n\n" << min << "th Floor with " << rooms[min] << " rooms, has the least number of rooms";

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

cout << "\n\nPROGRAMEER : YOUR NAME";

cout << "\nCMSC140 Common Project 3";

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

} // main ends

______

#include #include <iostream» <string> 3 #includeく10man!p> 4 5 using namespace std; 7 int main) f /I declare required variable49 50 51 52 53 54 cout << How many SINGLE rooms are occupied in the << i <<th floor : ; cin single[i]; cout << How many________

Output ::

Result... compiLed and executed in 17.817 sec(s) BlueMount Hotel Enter the Location of this hotel chain LA Enter total number

Add a comment
Know the answer?
Add Answer to:
**Use C++ ** Project Description The BlueMont chain hotels have 4 different types of room: Single...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C ++ Project Description The BlueMont chain hotels have 4 different types of room: Single room:...

    C ++ 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...

  • Write a complete Java program with methods that prompt user for the number of floors, rooms,...

    Write a complete Java program with methods that prompt user for the number of floors, rooms, occupied rooms in a hotel. You must validate floors, rooms, occupied rooms. Compute vacant rooms, occupancy rate on each floor and display rooms, occupied rooms, vacant rooms and occupancy rate for each floor. Use the given method names. See validation rules below: 1. getFloors(). This method prompts user for number of floors in a hotel and returns floors to the caller. 2. testFloors(floors). Do...

  • Sleepy Hollow Hotels Inc.(SH) operates two hotels in theMeto eion.ach hoeand rooms: standard room...

    Sleepy Hollow Hotels Inc.(SH) operates two hotels in theMeto eion.ach hoeand rooms: standard room and deluxe. SHH has a total of 300 deluxe rooms an following are the relevant budgeted and the actual results for SHH for the a etro region. Each hotel has two grades of reson70t May The ro Sales Revenue for 92 days in the Quarter: Budgeted Revenue Actual Revenue $8,721,600 $8,825,100 Average Daily Occupancy Rates Deluxe Standard # of Rooms 240 285 # of Rooms 490...

  • Course Project 1.You are going to research two local hotels. You will need to call or...

    Course Project 1.You are going to research two local hotels. You will need to call or visit the two properties. In addition make sure you research the hotels website and find the response to the following questions in detail: ​a. What is the rack rate for a “standard” room? ​b. What is included in this rate? ​c. What amenities are offered at their property – pool ,restaurant etc.? ​d. Are rates different on the weekend? Higher or Lower? ​e. What...

  • Star Inn is a chain of hotels. The reservation system is uses a centralized reservation database....

    Star Inn is a chain of hotels. The reservation system is uses a centralized reservation database. The database contains booking information on all hotels of Star Inn. The following is a description of the conceptual model of the hotel reservation database at Star Inn. The database contains information about hotels, hotel rooms, customers, and reservation. A hotel can be identified by its identification number (hotel_id). It is also described by hotel_name, address and phone_no. Rooms are identified by room_no which...

  • Problem 13-56 Prepare Budgeted Financial Statements: Comparing Alternatives (LO 13-7) HomeSuites is a chain of all-suite...

    Problem 13-56 Prepare Budgeted Financial Statements: Comparing Alternatives (LO 13-7) HomeSuites is a chain of all-suite, extended-stay hotel properties. The chain has 15 properties with an average of 200 rooms in each property. In year 1, the occupancy rate (the number of rooms filled divided by the number of rooms available) was 70 percent, based on a 365-day year. The average room rate was $180 for a night. The basic unit of operation is the “night,” which is one room...

  • HomeSuites is a chain of all-suite, extended-stay hotel properties. The chain has 18 properties with an...

    HomeSuites is a chain of all-suite, extended-stay hotel properties. The chain has 18 properties with an average of 220 rooms in each property. In year 1, the occupancy rate (the number of rooms filled divided by the number of rooms available) was 70 percent, based on a 365-day year. The average room rate was $170 for a night. The basic unit of operation is the “night,” which is one room occupied for one night. The operating income for year 1...

  • HomeSuites is a chain of all-suite, extended-stay hotel properties. The chain has 16 properties with an...

    HomeSuites is a chain of all-suite, extended-stay hotel properties. The chain has 16 properties with an average of 150 rooms in each property. In year 1, the occupancy rate (the number of rooms filled divided by the number of rooms available) was 70 percent, based on a 365-day year. The average room rate was $204 for a night. The basic unit of operation is the "night," which is one room occupied for one night. The operating income for year 1...

  • need help answering these with workout shown please 5-Star Lux Hotel Hotel Configuration Total Bed 1...

    need help answering these with workout shown please 5-Star Lux Hotel Hotel Configuration Total Bed 1 Bed 2 Bed 3 (Single) (Double) (Penthouse) 30 60 20 1 1 area per room (square metres) number of rooms first floor - 240 square metre second floor - 240 square metre third floor - 240 square metre number of rooms floor space square metres) planned occupancy rate (%) (open 365 days) average selling price (Stroom/night) 1 3 4 3 4 3 4 9...

  • I have part A completed I just need the required question at the end answered. Thanks  ...

    I have part A completed I just need the required question at the end answered. Thanks   : Total Rooms available 200 Total number of days in a year 365 Total room nights 73000 (200 X 365) Occupancy Rate 70% Total number of nights occupied 51100 (730000 X 70%) Total Lodging Revenue 11242000 Average Revenue per night/per room 220 (11242000 / 51100) Increase expected in 2nd lodge 5% New average revenue per night per room 231 Total Number of nights 102200...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT