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...
-
Determine the tax basis of the business asset acquired in each of the following cases: a. Firm L paid $5,950 cash plus $416 sales tax plus a $500 installation charge for a satellite dish. b. TTP Inc....
-
How might you develop multiple prototypes to seek a wide range of feedback from your target customer?
-
Sarah Lou Bakery, Inc., reported a prior-period adjustment in 2008. An accounting error caused net income of prior years to be overstated by \(\$ 5,000\). Retained earnings at December 31, 2007, as...
-
The background for this case was introduced in Chapter 1. This is a continuation of the case in Chapter 6. For this part of the case, propose and test some meaningful hypotheses that will help Ms....
-
Q1. There are thousands of architectural decisions to be made in the development of an automobile. Consider all of the likely fundamental and incidental interactions that any one functional element...
-
An analysis of transactions for Peat DeLoitte & Co. was presented in E1.8. Instructions Prepare an income statement and an owners equity statement for August and a balance sheet at August 31, 2020....
-
Strengths-based coaching: can potentially demotivate employees because they inherently seek feedback about their weaknesses. is consistent with the consequence of punishment in organizational...
-
a. Assume that \(y_{1}, \ldots, y_{n}\) are i.i.d. with a negative binomial distribution with parameters \(r\) and \(p\). Determine the maximum likelihood estimators. b. Use the sampling mechanism in...
-
Particles A, B, and C, with charges \(12.0 \mu \mathrm{C}, 8.0 \mu \mathrm{C}\), and \(-6.0 \mu \mathrm{C}\), respectively, are evenly spaced along a line, in that order, with spacing \(2.0...
-
Check whether the following can define probability distributions and explain your answers. (a) \(f(x)=\frac{1}{4}\) for \(x=10,11,12,13\) (b) \(f(x)=\frac{2 x}{5}\) for \(x=0,1,2,3,4,5\) (c)...
-
An infinitely long positively charged wire has a linear charge density \(\lambda=3 \mathrm{nC} / \mathrm{m}\). Calculate the electrostatic potential at distances of (a) \(1.0 \mathrm{~m},\) (b) ...
-
Mr. Smith wants to buy a car and is deciding between brands A and B. Car A costs \(\$ 20,000\), and Mr. Smith estimates that at the rate he drives he will sell it after 2 years and buy another of the...
-
The owners of the USHL stated they can tolerate 5 - yrs of operations if their team is sustainable after that time. At the end of the 5 - yrs , which team ( s ) will cease operations? Which team ( s...
-
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...
-
You are given the following information about two companies, partly extracted from their most recent statement of financial position and income statement, and partly taken from the financial press....
-
You are given the following information about Swin Gin plc: You are required to calculate the P/E ratio for each year, and comment on how the market appears to have reacted to changes in EPS. Year 1...
-
Assess the usefulness of P/E ratios and suggest how they might be misleading.
Study smarter with the SolutionInn App