#include "time.h"
int main()
{
Time begin;
Time end;
Time check_in;
Time diff;
int check;
int h, m, s;
begin.set (12,0, 0);
end.set (18, 0, 0);
cout << " enter hour, min, sec\n ";
cin >>h>>m>>s;
check_in.set (h, m, s);
cout << " the time you checked in ";
check_in.print ();
if (check_in.Equal(begin))
cout << "You are right on time. Lets go to lunch !! ";
if( check_in.LessThan(begin))
{
while(!begin.Equal(check_in))
{
begin.increment();
diff.increment;
}
h = diff.get_hour();
m = diff.get_mins();
s = diff.get_secs();
check = diff(begin.set:check_in:*s);
cout << " Good Morning you are early. You have to wait "<< check <<" for lunch !! ";
}
if( check_in.GreaterThan(begin))
{
while(!begin.Equal(check_in))
{
begin.increment();
diff.increment;
}
h = diff.get_hour();
m = diff.get_mins();
s = diff.get_secs();
check = diff(begin.set:check_in:*s);
cout << "Good Afternoon you are late. You have to wait "<< check <<" for dinner !! ";
}
return 0;
}[code]