/*Program:To add feet &inches
Date:25/7/12
Author:Anubha Chaturvedi
Description:To learn the concept of objects*/




#include<iostream.h>
#include<conio.h>
class Distance
{
int Feet,Inch;
public:
void get()
{
cout<<"enter Feet & Inches"<<endl;
cin>>Feet>>Inch;
cout<<endl;
}
void add(Distance ob1,Distance ob2)
{
Feet=ob1.Feet+ob2.Feet;
Inch=ob1.Inch+ob2.Inch;
}
void disp()
{
if(Inch>=12)
{
Feet=Feet+(Inch/12);
Inch=(Inch%12);
}
cout<<"Feets are"<<Feet<<"And inches Are"<<Inch;
}
};
void main()
{
Distance ob1,ob2,ob3;
clrscr();
ob1.get();
ob2.get();
ob3.add(ob1,ob2);
ob3.disp();
getch();
}