Find us On Facebook

Thursday, April 7, 2011

Operator

#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;}

0 comments:

Post a Comment

Programms

C,C++,VB, PL/SQL EBOOK SEARCH ENGINE