0% found this document useful (0 votes)
10 views2 pages

practiceQuestion

The document outlines the specifications for designing a HOTEL MANAGEMENT application for a hotel in Northern Cyprus. It details the necessary classes, including Hotel, Room, Customer, and Employee, along with their attributes and methods, such as constructors, destructors, and display functions. Additionally, it emphasizes the use of friend functions to calculate the total cost of a customer's stay based on the number of days and room cost per night.

Uploaded by

kaya-acarbay8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

practiceQuestion

The document outlines the specifications for designing a HOTEL MANAGEMENT application for a hotel in Northern Cyprus. It details the necessary classes, including Hotel, Room, Customer, and Employee, along with their attributes and methods, such as constructors, destructors, and display functions. Additionally, it emphasizes the use of friend functions to calculate the total cost of a customer's stay based on the number of days and room cost per night.

Uploaded by

kaya-acarbay8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Practice Question

Assume you are hired to design a HOTEL MANAGEMENT application for one of the hotels in
Northern Cyprus. The specifications are as follows:
 The hotel has a name, address (city), and includes many rooms (for testing use small
numbers).
 Each room has a room number, type (double, single, king suit, etc.…), and cost per night.
Cost varies according to the room types.
 There are two types of persons in the hotel; Customers and Employees. Each person
(customer or employee) has a full name (first and last), phone number, and a gender.
Additionally each customer’s date of birth (day, month, year) and the number of days that
they are going to spend in the hotel should be known. Employees should have a unique
employee id.
 Assume that a customer may rent only one room, and an employee may serve only one
room
 You are to add a function which should be friend of necessary classes in order to calculate
the total cost of customers stay in the hotel. The total cost should be calculated by using
the following data. The number of days the customers spend in the hotel and the rooms’
cost per night (number of days*cost per night).
IMPORTANT NOTE: The sample output is provided in the next page. You are free to design your
own output.
Create the necessary classes and the main function.
 Each class should include the necessary private/protected data members (use an
appropriate data type and name for each data member).
 Each class must have a parameterized constructor.
 Each class must have a destructor.
 Each class must include getter and setter methods.
 Each class additionally must include a method that displays its details.
The main function should include the following steps:
 Create dynamic objects for the necessary classes that is necessary to test the all classes
you have created.
 Call the necessary methods (display method) in order to display the details of the
necessary classes (SEE SAMPLE OUTPUT).
 Call the friend function to display the total cost for the customer.
You are to use friend functions/classes, composition and/or inheritance techniques. You are
expected to be as creative as you can. Feel free to add any necessary data member or method in
any of the classes.
Before you start, draw a class and/or object diagram in order to understand the relationships
between the classes.
SAMPLE OUTPUT

Hotel Name: XXXXX Address (City): YYYYY

Customer Information:

Name: John Smith Phone: Gender: DOB: Number of Stay: 5 days

Room Details for the Customer:

Room No: Type: Single Cost per night: 60 Euros

Employee Details responsible from the room:

Employee Id: Name: Gender:

Total Cost for Customer John Smith: 300 Euros

You might also like