Juan Rodriguez_Programming-C++II-1_Week 4_Individual work:Lab

Juan Rodriguez_Programming-C++II-1_Week 4_Individual work:Lab

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Program Program By: Juan Rodriguez Programming – C++II-1 May 2, 2016 1
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Program Add the following methods to the HotelRoom class: an accessor method for each instance variable of the class (Get_Number(), Get_Capacity(), Get_Status(), and Get_Rate()); a one-ar- gument method Change_Status() that changes the occupancy status of the room to the value of its argument. The method should verify that the argument value does not exceed the room capacity. If it does, the method should return –1. Finally, add this method to the Hotel Room class: a one-argument method Change_Rate() that sets the room rate to the value of its argument. Write a main() that creates a hotel room with room number 123, with 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 nicely formatted way. Now assume that the guests check out. Change the status of the room appropriately and display the information
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern