/*
A class is an expanded concept of a data structure: instead of holding only data, 
it can hold both data and functions.

An object is an instantiation of a class. In terms of variables, a class would 
be the type, and an object would be the variable.
*/

#include <iostream>
using namespace std;

class CRectangle 
{
      int width, height;
      public:
             void set_values (int, int);
             
             int area () 
             {
                 return (width*height);
             }
};

void CRectangle::set_values (int a, int b) 
{
     width  = a;
     height = b;
}

int main() 
{
    CRectangle rect1, rect2;
    rect1.set_values(3,4);
    rect2.set_values(5,6);
    
    cout << "Area of rect1: " << rect1.area() << endl;
    cout << "Area of rect2: " << rect2.area() << endl;
    
    std::cin.get();
    return (0); 
} 
    
