Question: Please write program in C++ For this assignment you are going to write a program for a hotel company to keep track of customer information
For this assignment you are going to write a program for a hotel company to keep track of customer information and fees. Create an inheritance hierarchy containing base class Room and derived classes Basic room, Premium room, and Suite room Base class room should include a data member of type double to represent the customer's total amount due. The class should provide a constructor that receives the flat rate of the amount due for the hotel room without any added fees and initialize the data member. This balance must be valid, meaning the amount due is greater than SO. If value below 0 error message will occur and will ask for reentry. The class will have member function credit, charge, inflated, deflated, and getbalance. Credit will credit the customer's account with a certain amount depending on the reason for the credit. The only reason a costumer should get credit to their account is if they hotel is running a special, the customer has a coupon/discount code, or if the customer's had a bad experience or inconvenience during their stay. Credited amount should not exceed that flat rate cost of the hotel. If the credit does exceed cost then an exception will occur. The exception will automatically reconfigure the credited amount so that balance is S50. Member function charge should add on any fee if the was damage to the room or if the customers add another night. Depending on what season it is, the hotel's cost will either be inflated or deflated. In summer and winter the base cost is inflated and in the spring and fall costs are deflated. Member function inflated will add inflation amount to base amount. Member function deflated will subtract deflation from base amount. Member function getbalance should return the current balance. If customer has multiple rooms user overloaded operator to add the total price of each hotel room together under Derived class Basic room should inherit the functionality of Room and include data member of type double that represents the fee charged. Basic_room's constructor should receive the initial balance, as well as a parameter indicating the inflation amount. Another constructor should receive the initial balance as well as a parameter indicating the deflation amount. Basic room should redefine member functions charge and credit so they update the balance due accordingly depending on the room fees and/or discounts. You should use base class to update balance Derived class Premium room should inherit the functionality of Room and include data member of type double that represents the fee charged. Premium room's constructor should receive the initial balance, as well as a parameter indicating the inflation amount. Another constructor should receive the initial balance as well as a parameter indicating the deflation amount. Premium room should redefine member functions charge and credit so they update the balance due accordingly depending on the room fees and/or discounts. You should use base class to update balance Derived class Suite_room should inherit the functionality of Room and include data member of type double that represents the fee charged. Suite room's constructor should receive the initial balance, as well as a parameter indicating the inflation amount. Another constructor should receive the initial balance as well as a parameter indicating the deflation amount. Suite room should redefine member functions charge and credit so they update the balance due accordingly depending on the room fees and/or discounts. You should use base class to update balance Flat rate for each room per night: basic-S100, premium $150 suite-S200 Summer and Winter price increase: basic-S50 increase, premium$75 increase, suit-S100 increase Fall and spring price decrease: basic, premium, and suite $25 decrease There should also be a template class incorporated to enter in and store customer information of any type. The information that will be store is they name, date of birth, phone number, card number, address, and email. If any of these have invalid entries then an exception will be thrown and handled by allowing a reentry of information template class should be in separate namespace Write a program that tests the template class and the hierarchy by creating objects of each class. For this assignment you are going to write a program for a hotel company to keep track of customer information and fees. Create an inheritance hierarchy containing base class Room and derived classes Basic room, Premium room, and Suite room Base class room should include a data member of type double to represent the customer's total amount due. The class should provide a constructor that receives the flat rate of the amount due for the hotel room without any added fees and initialize the data member. This balance must be valid, meaning the amount due is greater than SO. If value below 0 error message will occur and will ask for reentry. The class will have member function credit, charge, inflated, deflated, and getbalance. Credit will credit the customer's account with a certain amount depending on the reason for the credit. The only reason a costumer should get credit to their account is if they hotel is running a special, the customer has a coupon/discount code, or if the customer's had a bad experience or inconvenience during their stay. Credited amount should not exceed that flat rate cost of the hotel. If the credit does exceed cost then an exception will occur. The exception will automatically reconfigure the credited amount so that balance is S50. Member function charge should add on any fee if the was damage to the room or if the customers add another night. Depending on what season it is, the hotel's cost will either be inflated or deflated. In summer and winter the base cost is inflated and in the spring and fall costs are deflated. Member function inflated will add inflation amount to base amount. Member function deflated will subtract deflation from base amount. Member function getbalance should return the current balance. If customer has multiple rooms user overloaded operator to add the total price of each hotel room together under Derived class Basic room should inherit the functionality of Room and include data member of type double that represents the fee charged. Basic_room's constructor should receive the initial balance, as well as a parameter indicating the inflation amount. Another constructor should receive the initial balance as well as a parameter indicating the deflation amount. Basic room should redefine member functions charge and credit so they update the balance due accordingly depending on the room fees and/or discounts. You should use base class to update balance Derived class Premium room should inherit the functionality of Room and include data member of type double that represents the fee charged. Premium room's constructor should receive the initial balance, as well as a parameter indicating the inflation amount. Another constructor should receive the initial balance as well as a parameter indicating the deflation amount. Premium room should redefine member functions charge and credit so they update the balance due accordingly depending on the room fees and/or discounts. You should use base class to update balance Derived class Suite_room should inherit the functionality of Room and include data member of type double that represents the fee charged. Suite room's constructor should receive the initial balance, as well as a parameter indicating the inflation amount. Another constructor should receive the initial balance as well as a parameter indicating the deflation amount. Suite room should redefine member functions charge and credit so they update the balance due accordingly depending on the room fees and/or discounts. You should use base class to update balance Flat rate for each room per night: basic-S100, premium $150 suite-S200 Summer and Winter price increase: basic-S50 increase, premium$75 increase, suit-S100 increase Fall and spring price decrease: basic, premium, and suite $25 decrease There should also be a template class incorporated to enter in and store customer information of any type. The information that will be store is they name, date of birth, phone number, card number, address, and email. If any of these have invalid entries then an exception will be thrown and handled by allowing a reentry of information template class should be in separate namespace Write a program that tests the template class and the hierarchy by creating objects of each class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
