Question

Please help me to write a c++ program that will Implement a HotelRoom class, with private...

Please help me to write a c++ program that will Implement a HotelRoom class, with private data members: the room number, room capacity (representing the maximum number of people the room can accommodate), the occupancy status (0 or the number of occupants in the room), the daily room rate.
Member functions include:
• a 4-argument constructor that initializes the four data members of the object being created (room number, room capacity, room rate, occupancy status) to the constructor's arguments. The room rate defaults to 89.00 and the occupancy status defaults to 0.
• A destructor
• accessor functions
• a print function
• a function changeRate that sets the room rate to the value of its argument
• a function changeStatus that changes the occupancy status of the room to the value of its argument. The function should verify that the argument value does not exceed the room capacity; if it does, the function should return -1.
And also help me to write a main() that creates a hotel room with room number 123, a capacity of 4, and a rate of 150.00. Suppose a person checks in. The program should ask the user to enter the number of guests to occupy the room. Change the status of the room to reflect the number of guests that just checked in. Display the information about the room in a nice format. Now assume that the guests check out. Change the status of the room appropriately and display the information about the room. Next, change the room rate to 175.00. Finally assume that another person checks in. Ask the user to enter the number of guests to occupy the room. Change the room's status accordingly and display the new information about the room. Thanks

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Please help me to write a c++ program that will Implement a HotelRoom class, with private...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • C++ Define the class HotelRoom. The class has the following private data members: the room number...

    C++ Define the class HotelRoom. The class has the following private data members: the room number (an integer) and daily rate (a double). Include a default constructor as well as a constructor with two parameters to initialize the room number and the room’s daily rate. The class should have get/set functions for all its private data members [3pts]. The constructors and the set functions must throw an invalid_argument exception if either one of the parameter values are negative. The exception...

  • please use c++ Write a program that contains a class Rectangle with two private double precision...

    please use c++ Write a program that contains a class Rectangle with two private double precision members iLength and iWidth, public set and get member functions for these two members, a two argument constructor that sets the length and width to any two user specified values and a void function area() that computes the area and then prints this value by inserting it into the cout output stream. Write a main function that ereates a Rectangle with a length of...

  • I need this code in C programming. Can anyone pls help me in this? Project 8,...

    I need this code in C programming. Can anyone pls help me in this? Project 8, Program Design A hotel owner would like to maintain a list of laundry service requests by the guests. Each request was stored with the room number, the guest's first name, last name, and number of items. The program laundry_list.ccontains the struct request declaration, function prototypes, and the main function. Complete the function definitions so it uses a dynamically allocated linked list to store the...

  • Please help with this assignment. Thanks. 1. Write a C++ program containing a class Invoice and...

    Please help with this assignment. Thanks. 1. Write a C++ program containing a class Invoice and a driver program called invoiceDriver.cpp. The class Invoice is used in a hardware store to represent an invoice for an item sold at the store. An invoice class should include the following: A part number of type string A part description of type string A quantity of the item being purchased of type int A price per item of type int A class constructor...

  • In C++, Step 1: Implement the Student Class and write a simple main() driver program to...

    In C++, Step 1: Implement the Student Class and write a simple main() driver program to instantiate several objects of this class, populate each object, and display the information for each object. The defintion of the student class should be written in an individual header (i.e. student.h) file and the implementation of the methods of the student class should be written in a corresponding source (i.e. student.cpp) file. Student class - The name of the class should be Student. -...

  • 8. (15 marks) Write a complete C program, which uses an array of structures and two...

    8. (15 marks) Write a complete C program, which uses an array of structures and two user defined functions. The program deals with a library database. The program will ask the user to input required information about each book and store it in a structure in a user defined function called get info. The second user defined function display_info will display database information on the screen. The output should look as follows: Book Title Book ld 123456 C Programming 10...

  • C++ Please Provide .cpp Overview For this assignment, implement and use the methods for a class...

    C++ Please Provide .cpp Overview For this assignment, implement and use the methods for a class called Player that represents a player in the National Hockey League. Player class Use the following class definition: class Player { public: Player(); Player( const char [], int, int, int ); void printPlayer(); void setName( const char [] ); void setNumber( int ); void changeGoals( int ); void changeAssists( int ); int getNumber(); int getGoals(); int getAssists(); private: char name[50]; int number; int goals;...

  • C programing Write a program to sort numbers in either descending or ascending order. The program...

    C programing Write a program to sort numbers in either descending or ascending order. The program should ask the user to enter positive integer numbers one at a time(hiting the enter key after each one) The last number entered by the user should be -1, to indicate no further numbers will be entered. Store the numbers in an array, and then ask the user how to sort the numbers (either descending or ascending). Call a function void sortnumbers ( int...

  • I am struggling with a program in C++. it involves using a struct and a class...

    I am struggling with a program in C++. it involves using a struct and a class to create meal arrays from a user. I've written my main okay. but the functions in the class are giving me issues with constructors deconstructors. Instructions A restaurant in the Milky way galaxy called “Green Alien” has several meals available on their electronic menu. For each food item in each meal, the menu lists the calories per gram and the number of grams per...

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