Static and Friend Functions
Static Variables In Functions
Static Class Data Members
Static and Friend Functions
in addition to the files provided for you copy over your Computer.h and Computer.cpp from the previous lab
you will be making some additions to the Computer class
static int count
you will add the private static member count
it will be of type integer
initialize the data member to 0 ( you will do this in your computer.cpp)
increment the count in all of the constructors
decrement count in the destructor
create a public accessor function named GetCount ( this will be a static function )
it simply returns the value in count
friend functions
create the following functions these functions will NOT be part of the class they will be friend functions
note: to compare a class you will multiple the number of cores x processor speed you will use this result
as the base to compare with so two Computers can be either <, > or ==
bool Greater(const Computer & , const Computer & )
bool Less(const Computer & , const Computer & )
bool Equal(const Computer & , const Computer & )
put the functions in computer.cpp, they are not part of the computer class so the function names do not need to be prefixed with Computer::
put the above listed function prototypes Greater , Less and Equal in your friend class. prefix them with friend and end them with ;
A Makefile,example and a test main has been provided for you
your output to the console and to the logfile MUST match the example