Question: Write a C++ program. Question# 1: Here is defined the class called UniversityCampus, you have to implement basic operations on UniversityCampus. There can be many

Question# 1: Here is defined the class called UniversityCampus, you have to

Write a C++ program.

Question# 1: Here is defined the class called UniversityCampus, you have to implement basic operations on UniversityCampus. There can be many Departments in a campus. A UniversityCampus will have CampusName, Number of Faculty Members per department (noOfFacMembers) and Number of Staff Members per department (noOfStaffMembers). The index used for a department name is same as the Number of Faculty Members for that department in the array noOfFacMembers and for Staff Members in array noOfStaffMembers respectively. Consider the driver program given class UniversityCampus { below. Add all necessary methods char * CampusName; to this class, so that driver program char **Departments: //Stores names of all Departments. works properly, without any int "noOfFacMembers; //Stores the Number of faculty Members in array compile, run time or logical errors. int "noOfStaffMembers; //Stores the Number of Staff Members in array Specifically: provide the necessary }/You can not add any new Data Member. constructors and operators. Read the comments in the driver program to get a hint that how the methods work. Do not add useless getter /setters unless or until they are required. For Sections A,B,C,D. For Sections E,F. int main(){ char *dpts[20] = {"CS", "EE", "A&F", nullptr}; int faculty[] = {46,33,23}; int staff [] = {4, 3, 5}; UniversityCampus *1hr= new UniversityCampus ("Lahore", dpts, faculty, staff); ihr->printCampusDetails(); All code is same as sections A,B,C&D have, except below these two functions. 1hr->addDepartment (Mng"); //Adds the department and sets the value of faculty and staff for tis department *1hr = *lhr + "Mng"; //Adds the department and sets the value of faculty and staff for tis department to zero. to zero. 1hr->addFaculty("Mng", 44); //Finds the department, if found adds the number of faculty members. 1hr ->addStaff("Mng", 4); //Finds the department, if found adds the number of Staff members. 1hr->removeDepartment ("EE"); //Removes the all data of E department. lhr->printCampusDetails(); *1hr = *1hr - "EE"; //Removes the all data of EE department. 1hr->printCampusDetails(); //delete the memory you have taken from Heap.

Step by Step Solution

3.40 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include include using namespace std class UniversityCampus char CampusName char Departments Stores names of all Departments int noOfFacMembersStores t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!