#include <iostream.h>
#include <conio.h>
class distance
{
int feet;
float inches;
public:
distance() //constructor1
{feet=0;inches=0;}
distance(int ft,float inch) //constructor2
{feet=ft;inches=inch;}
void getdata()
{ cout<<"Enter Feet and inches respectively: ";
cin>>feet>>inches;
}
void display()
{ cout<<"Feet : "<<feet<<endl<<"Inches :"<<inches;}
#include <conio.h>
class distance
{
int feet;
float inches;
public:
distance() //constructor1
{feet=0;inches=0;}
distance(int ft,float inch) //constructor2
{feet=ft;inches=inch;}
void getdata()
{ cout<<"Enter Feet and inches respectively: ";
cin>>feet>>inches;
}
void display()
{ cout<<"Feet : "<<feet<<endl<<"Inches :"<<inches;}
0 comments:
Post a Comment