Answer:
Step-by-step explanation:
#include
static const int MAX_SIZE=10; //Class scope
// Return the max value
static double max(double d1) //Function scope
{
static double lastMax = 0; //Function scope
lastMax = (d1 > lastMax) ? d1 : lastMax; //Function scope
return lastMax; //Module Scope
}
// Singleton class only one instance allowed
class Singleton
{
public:
static Singleton& getSingleton() //Function scope
{
return theOne; //Module Scope
}
// Returns the Singleton