If I have to create a .h and .cpp file and I have to work with abstract classes and classes that inherit from the base class. How should I break down the header and cpp file? I'm not sure which goes where and what should be defined in which. It's alittle clearer in java for me.
Every class has a function called "void Print()" which prints out a message describing everything known about the class object. Each class also has an inlined function for every private member variable that returns the value of that variableCode:* Person - This is an abstract class that will be inherited by all other classes.
o Private data:
+ std::string name
+ int age
+ int years_in_college (years of college completed)
+ enum {male, female} sex
* Student - A Student is a Person.
o Private data:
+ std::string major
+ bool transfer (true if transferred to UCSB from another college or university)
* Employee - An Employee is a Person.
o Private data:
+ std::string department
* Faculty - A Faculty is an Employee.
o Private data:
+ enum {assistant, associate, full} level
* Staff - A Staff is an Employee.
o Private data:
+ enum {fulltime, parttime} status
* GradStudent - A GradStudent is a Student.
o Private data:
+ enum {masters, PhD} degree
* Dean - A Dean is a Faculty.
o Private data:
+ enum {grad, bren, education, CCS, Engr, LS} division
* Chancellor - A Chancellor is a Faculty.
o Private data:
+ bool CameFromUC
Each class has a private static int called "count" which keeps track of how many instantiations of the class there are. The static function "int& Count()" returns the value of the static variable "count" - since it uses a reference return type, this can also be used to set the value of "count", like this: Count() = 0. This static variable is used to ensure that no more than 1 Chancellor is instantiated, no more than 6 deans, and no more than N people overall, where N is specified by the programmer at the beginning of the main() function like this:
If someone can give me a qucik template of what needs to go where that would be most grateful. Our professor hasn't done a good job explainging classes and how they are created and called.