/** Time.h -----------------------------------------------------------
 This header file defines the data type Time for processing time.
   Basic operations are:
   Set:      To set the time
   Display:  To display the time
   Advance:  To advance the time by a certain amount
   LessThan: To determine if one time is less than another
----------------------------------------------------------------------*/

#include <iostream>
using namespace std;

struct Time
{
   unsigned hour,
            minute;
   char AMorPM;        // 'A' or 'P'
   unsigned milTime;   // military time equivalent
 };


/*-----------------------------------------------------------------
 Set sets the time to a specified values.

   Receive:  hours, the number of hours in standard time
             minutes, the number of minutes in standard time
             AMPM ('A' if AM, 'P' if PM
   Return:   The time t set to specific values.
------------------------------------------------------------------*/

void Set(Time & t, unsigned hours, unsigned minutes, char AMPM);


/*-----------------------------------------------------------------
 Display displays time t in standard and military format using
 output stream out.

   Receive:  Time t and ostream out
   Output:   The time T
------------------------------------------------------------------*/

void Display(const Time & t, ostream & out);

/*-----------------------------------------------------------------
 Advance increments a time by a specified value.

   Receive:  hours, the number of hours to add
             minutes, the number of minutes to add
   Return:   The time t with data members incremented by these
             values.
------------------------------------------------------------------*/

void Advance(Time & t, unsigned hours, unsigned minutes);


/*-----------------------------------------------------------------
 < determines if one time is less than another time.

   Receive:  Times t1 and t2
   Return:   True (1) if t1 < t2, false otherwise.
------------------------------------------------------------------*/

bool LessThan(const Time & t1, const Time & t2);