Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Building: For each building, we store: Building name ( data type: char pointer ) Size in m 2 ( data type: int ) Rooms (

Building:
For each building, we store:
Building name (data type: char pointer)
Size in m2(data type: int)
Rooms (an array of rooms): You can assume that there will be a maximum of 100 rooms
for each building, including offices and classrooms.
Number of rooms (data type: int)
For each building, implement the following member functions:
A default (no-argument) constructor to set the building name to Undefined, size to -1,
and the number of rooms to zero.
A constructor to set the building name to a given name, size to a given size, and the number
of rooms to zero.
Getter and setter functions for building name and size, and a getter function for the number
of rooms.
addRoom()- A function to add a new room to the building.
printBuilding()- A function that prints the building with its name, size, and number of
rooms.
printRooms()- A function that prints all the details of rooms in the building.
printRoomsByType()- A function to print the details of each room in the building whose
type is a given type (1: Classroom or 2: Office).
getNumberOfClassrooms()- A function that returns the number of classrooms in the
building.
getTotalCapacity()- A function that returns the total capacity of the offices in the
building.
getNumberOfOffices()- A function that returns the number of offices in the building.
printAvailableOffices()- A function to print the details of the offices which are not full
in the building.
printSuitableClassrooms() A function that takes the number of students and prints the
details of the suitable classrooms (based on the capacity of the rooms) in the building.
Room:
For each room, we store:
Room name (data type: char pointer)
Floor no (data type: int)
For each room, implement the following member functions:
A default (no-argument) constructor to set room name to Undefined and floor no to -1.
A constructor to initialize all the member variables with given values.
Middle East Technical University
Northern Cyprus Campus
4
Getter and setter functions for each of the member variables.
printRoom()- A function to print a room with all its details.
Office:
Each office is a room with an additional following attribute:
Office type (data type: enum officeType {None, CoordinatorOffice, StandardOffice,
SharedOfficeFor2People, SharedOfficeFor3People, SharedOfficeFor10People})
Number of people in the office (data type: int)
Please note that CoordinatorOffice and StandardOffice are not shared offices.
For each office, implement the following member functions:
A default (no-argument) constructor to set room name to Undefined, floor no to -1, office
type to None, and number of people in the office to zero.
A constructor to initialize all the member variables with given values.
Getter and setter functions for the member variables.
isFull() A function that returns whether an office is full or not.
getCapacity() A function that returns the capacity of an office (None: 0,
CoordinatorOffice: 1, StandardOffice: 1, SharedOfficeFor2People: 2,
SharedOfficeFor3People: 3, SharedOfficeFor10People: 10).
printRoom()- A function to print an office with all its details, including its capacity and
availability.
Classroom:
Each classroom is a room with an additional following attribute:
Capacity (datatype: int)
For each classroom, implement the following member functions:
A default (no-argument) constructor to set room name to Undefined, floor no and
capacity to -1
A constructor to initialize all the member variables with given values.
Getter and setter functions for the member variables.
checkSuitability()- A function that takes a number of students and checks if the capacity
of the classroom is suitable for the number of students. If so, it returns true, otherwise it
returns false.
printRoom()- A function to print a classroom with its all details.
PART TWO: A UNIVERSITY CAMPUS MANAGEMENT SYSTEM
You need to implement a command-line interface for a campus management system which
provides the following menu for the university with the name METU NCC.
1. Add a new building to the university.
2. Add a new room (classroom or office) to a selected building.
Middle East Technical University
Northern Cyprus Campus
5
3. Print the buildings in the university.
4. Print the rooms in each building in the university.
5. Print the rooms in each building in the university based on a provided type (1: Classroom
or 2: Office)
6. Print the total number of classrooms and offices in the university.
7. Print the available offices in each building in the university.
8. Print the total capacity of all the offices.
9. Print the suitable classroom in the university based on the given number of students.
10. Exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions