// 04222008b.cpp, P H Anderson, Apr 22, '08

#include <stdio.h>
#include <math.h>

typedef struct 
{
    float x, y;
} RECT;

typedef struct
{
    int hr, mi, se;
} TM;

#define WAIT()  while(getchar() != 'x')
#define FRACT_PART(x) x - (float)(int)x;
#define LO_CASE(x) ((x>='A') && (x<='Z')) ? (x- 'A' + 'a') : (x);

int calc_diff(TM *p1, TM *p2);
void calc_roots(float a, float b, float c, RECT *p1, RECT *p2);

int main()
{
   int num_secs; 
   TM tm1 = {3, 45, 1}, tm2 = {15, 31, 5};
   
   RECT root_1, root_2;
   
   float x;
   char ch;
   
   num_secs = calc_diff(&tm1, &tm2);   
   printf("Number of secs = %d.\n", num_secs);
   
   calc_roots(1, 3, 4, &root_1, &root_2);
   printf("Root1 %.2f\t%.2f\, Root2 %.2f\t%.2f\n", root_1.x, root_1.y,
                                                   root_2.x, root_2.y);     
   
   WAIT();
   x = FRACT_PART(M_PI);
   printf("%.8f\n", x);
   
   ch = 'W';
   ch = LO_CASE(ch);
   printf("%c\n", ch);
   
   WAIT();    
}

int calc_diff(TM *p1, TM *p2)
{ // stub
    int diff;
    
    diff = (p2->hr - p1->hr) * 3600;
    return(diff);
}

void calc_roots(float a, float b, float c, RECT *p1, RECT *p2)
{ // stub

     p1->x = 3.0; p1->y = 4.0;
     p2->x = 3.0; p2->y = -2.0;
}