Write a C++ program. Question# 1: Here is defined the class called UniversityCampus, you have to implement
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a C++ program.
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
include include using namespace std class UniversityCampus char CampusName char Departments Stores names of all Departments int noOfFacMembersStores t... View the full answer
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date:
Students also viewed these programming questions
-
Dangerfield Pty Ltd would like to determine the variable rate for electricity per machine hour in order to estimate the electricity costs for the months of May and June. Information for the four...
-
C & S Department Store is the second largest clothing and retail store chain in Jamaica. At present, they have 5 clothing and retail stores in all 14 parishes and are planning to expand to 7...
-
A coil C of N turns is placed around a long solenoid S of radius R and n turns per unit length, as in Figure. (a) Show that the mutual inductance for the coil-solenoid combination is given by M =...
-
Suppose in a given area there are three power plants, each of which emits SO 2 with different intensities. The abatement cost functions for each firm j are: (a) Set up the conditions for the socially...
-
How often do you think performance appraisals should be conducted?
-
Two drivers-Walt and Jessie-each drive up to a gas station. Before looking at the price, each places an order. Walt says, "I'd like 10 gallons of gas." Jessie says, "I'd like $10 worth of gas." What...
-
What are the characteristics of the NextGen SCM?
-
For 2012, Avatar Industries Inc. initiated a sales promotion campaign that included the expenditure of an additional $35,000 for advertising. At the end of the year, Leif Grando, the president, is...
-
Charles works ten hours a day. He receives a 20 minute unpaid break each shift. His hourly wage is $15.00 per hour. He normally works six days a week for a total of 60 hours per week. Charles has...
-
Sandra?s Purse Boutique has the following transactions related to its top-selling Gucci purse for the month of October. Required: 1. Calculate ending inventory and cost of goods sold at October 31,...
-
How religious influences impact cultural values?
-
Describe five forms of security over assets that could be required to minimise the risk exposure of lenders.
-
What is the interest payments option? How does it differ from the installment payments option? Why do some people postpone buying life insurance even when they need it? What are living benefits?...
-
Consider a software application you use regularly. What task(s) does it improve or enable? Suggest three ways the application could be improved. Would any of these improvements be considered an...
-
Jamie Lee and Ross need to ensure that the surviving spouse and the children will not have financial hardship in the event of a loss. Ross has $3000 salary. Using the easy method and considering Ross...
-
Before the pump is started, the water level is measured at 144 ft. The pump is then started. If the pumping water level is determined to be 161 ft, what is the well drawdown? The static water level...
-
Determine the running time of the following algorithms. Write summations to represent loops and simplify. Justify your solution. When using upper and lower bounds, be sure to justify both the upper...
-
Explain the term "Equivalent Units". Why are they calculated in process costing? [4 Marks] [minimum 350 words]
-
How can management accounting information produce behavioral and organizational reactions?
-
Refer to the In Practice description of Teach for America on pages 4445. How can Teach for America use its strategy map and scorecard to advance its mission and strategy?
-
Achieving objectives Eni Corporations mission statement includes the following: Our mission is to continuously improve the companys value to shareholders, customers, employees, and society. Interpret...
-
A domestic refrigerator consists of (a) A condenser, a compressor and an evaporator (b) A condenser, a throttling valve, a compressor and an evaporator (c) A condenser, a throttling valve and an...
-
The diathermal wall (a) Is incapable of exchanging heat with the surroundings (b) Permits the full flow of heat from the system to the surroundings and vice versa (c) Both (a) and (b) (d) None of...
-
What is the effect of pressure on equilibrium conversion of a gas-phase chemical reaction?
Study smarter with the SolutionInn App