Answered step by step
Verified Expert Solution
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 mdata type: int
Rooms an array of rooms: You can assume that there will be a maximum of rooms
for each building, including offices and classrooms.
Number of rooms data type: int
For each building, implement the following member functions:
A default noargument constructor to set the building name to Undefined size to
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 : Classroom or : 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 noargument constructor to set room name to Undefined and floor no to
A constructor to initialize all the member variables with given values.
Middle East Technical University
Northern Cyprus Campus
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,
SharedOfficeForPeople, SharedOfficeForPeople, SharedOfficeForPeople
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 noargument constructor to set room name to Undefined floor no to 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:
CoordinatorOffice: StandardOffice: SharedOfficeForPeople:
SharedOfficeForPeople: SharedOfficeForPeople:
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 noargument constructor to set room name to Undefined floor no and
capacity to
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 commandline interface for a campus management system which
provides the following menu for the university with the name METU NCC
Add a new building to the university.
Add a new room classroom or office to a selected building.
Middle East Technical University
Northern Cyprus Campus
Print the buildings in the university.
Print the rooms in each building in the university.
Print the rooms in each building in the university based on a provided type : Classroom
or : Office
Print the total number of classrooms and offices in the university.
Print the available offices in each building in the university.
Print the total capacity of all the offices.
Print the suitable classroom in the university based on the given number of students.
Exit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started