Implement a hotelroom class

Assignment Help C/C++ Programming
Reference no: EM131071837

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.

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.

Reference no: EM131071837

Questions Cloud

Calculate the net present value ignoring additional benefits : Calculate the net present value, ignoring the additional benefits described by Rick. Should the tow truck be purchased? Calculate the net present value, incorporating the additional benefits suggested by Rick. Should the tow truck be purchased?
Are jung beliefs similar to those in christianity : You are to compare Jung's' viewpoint of religion with some of the basic tenets of the Christian faith. Are Jung's beliefs similar to those in Christianity? Why or why not? You need to have at least three academic references outside of your text ..
Create a program that takes in a positive integer number : Create a program that takes in a positive integer number from the user and searches for the number with the highest sum of divisors from the 1 to the user imputed number
Create a map and store social security numbers by names : Create a map and store social security numbers by names. Iterate through your container and retrieve all names. Seach for an individual name and print the ssn
Implement a hotelroom class : 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
Identify two potential trading partners with justification : Analyze in a minimum of 1,050 words, using this case study as the basis, the impact of currency manipulation on cross-border trade and investment activities.
Write your maximum error-free channel capacity function : For your function what is the instantaneous rate of change in maximum error-free channel capacity with respect to SNR, for SNR=30? What is the equation of the tangent line to the graph of C(SNR), when SNR=30?
Eliminate exchange rate risk : (a) Detail the hedging strategy with options. (b) Estimate the cost today of an options strategy that will eliminate exchange rate risk.
Create a sourcing plan for future requirements : Develop a document that creates a sourcing plan for future requirements. In the sourcing plan, you should explain inclusions that should be made in contracts formed in the future

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Struct definition as the page table entry

Struct definition as the page table entry and the array that follows it as the page table. Implement the software simulation of least recently used algorithm in two C++ functions. Should RUN on UNIX.

  Program to implement an abstract data type rational-numbers

You are writing a program to implement an abstract data type Rational-Numbers. A rational number has two parts, numerator and denominator. Example 1/2 and 3/5 are rational numbers. You can perform math operations on rational numbers and the result..

  Identify two key oo concepts and explain them as if you

1. discuss the advantages and disadvantages of both the structured and object-oriented oo paradigm in programming. why

  Linear programming feasible region

Enumerate all points in the linear programming feasible region in which both x1 and x2 are integers, and show that the feasible solution obtained in (c) is not optimal and that in fact the optimal integer is not obtained by any form of rounding.

  You will implement a simplified version of the set class

you will implement a simplified version of the set class. you must implement all functions defined in the provided file

  The stack parameters will not be const reference

In this second case, the stack parameters will not be const reference parameters because they are temporarily changed before being restored. As an alternative, the parameters could be value parameters (so that changing them does not affect the act..

  Average and maximum error

The program uses the average and maximum error of the two values. c.

  Program that allows the user to enter the last names

Write a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate.

  Calculate the cube of a number

Write a program that will calculate the cube of a number. Do this by writing a user defined function that returns the cube of the value passed to it. Print out the results from main.

  Modify the test score application

Modify the Test Score application so that it uses Big Decimal arithmetic to calculate the average test score with result rounded to 1 decimal place. Note that because the scoreCount and scoreTotal are int, you don't have to create the Big Decimal ..

  Create the switch statement to implement set of conditions

Create the necessary switch statement to implement this set of conditions.

  Write a function that computes length of a character string

Write a function that computes the length of a character string (i.e. write your own implementation of the strlen function.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd