Problem 15:

1. Create a new workspace.

2. Create a new header file named demo.h

class demoClass
{
public:
	demoClass(int a=5, int b=10);
	int max() const;
	void display() const;
private:
	int itemA, itemB;
};

3. Create a new source file named demo.cpp

#include<iostream>
#include"demo.h"
using namespace std;

demoClass::demoClass(int a, int b)
{
	itemA = a;
	itemB = b;
}

void demoClass::display() const
{
	cout<<"ItemA = " << itemA << endl;
	cout<<"ItemB = " << itemB << endl;
}

int demoClass::max() const
{
	if(itemA > itemB)
		return itemA;
	else
		return itemB;
}

4.Create a new source file named Application.cpp

#include<iostream>
#include"demo.h"
using namespace std;

void main()
{
	demoClass obj1(7, 9);
	demoClass obj2(12);
	demoClass obj3;

	cout<<"obj1:" <<endl; 
	obj1.display();

	cout<<"\nobj2:" <<endl; 
	obj2.display();

	cout<<"\nobj3:" <<endl; 
	obj3.display();

	cout<<"\nThe max of obj1 is "<<obj1.max()<<endl;
	cout<<"The max of obj2 is "<<obj2.max()<<endl;
	cout<<"The max of obj3 is "<<obj3.max()<<endl;
}

5. Compile / Link /Run.