Write a C++ Program for Conversion from CLASS TO BASIC : TIME CONVERSION
//Conversion CLASS TO BASIC
//TIME CONVERSION
#include
#include
class time
{
int hrs;
int mins;
public:
time()
{}
void getdata()
{
cout<<"Enter value for Hours : "; cin>>hrs;
cout<<"Enter value for Minutes: "; cin>>mins;
}
void display()
{
cout<<"\n\nHours : "<
cout<<"\nMinutes : "<
}
operator int()
{
int t;
t = hrs*60;
t = t + mins;
return t;
}
};
void main()
{
clrscr();
time o1;
o1.getdata();
o1.display();
int duration;
duration=o1;
cout<<"\nDuration : "<
getch();
}