// Division.cpp: implementation of the CDivision class. // ////////////////////////////////////////////////////////////////////// #include "Division.h" #include "Department.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CDivision::CDivision() { } CDivision::~CDivision() { } CDivision::CDivision(CDepartment depart1, CDepartment depart2) { n_departments=2; // number of departments. department1=depart1; department2=depart2; } CDivision::CDivision(CDepartment depart1) { n_departments=1; department1=depart1; } int CDivision::count() { if(n_departments==1) { return department1.n_computers; } if(n_departments==2) { return department1.n_computers + department2.n_computers; } return 9999; }