/*********************************************
This program reads trial data from a roach
experiment, reads a time from the user, and
tells the user where the roach was going at
that point in time.
**********************************************/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
/*********************************************
** PROTOTYPES & STRUCT DEFINITIONS
*********************************************/
//--- POINT ---------------------------------//
struct point
{
double x, y;
};
istream& operator >> (istream& in, point& p);
ostream& operator << (ostream& os, point p);
//--- TIME IN HH:MM:SS ----------------------//
struct hhmmss
{
int h,m,s;
};
istream& operator >> (istream& is, hhmmss& T);
bool operator < (hhmmss a, hhmmss b);
//--- A DATA READING FROM THE EXPERIMENT ----//
struct datum
{
point position;
hhmmss time;
};
istream& operator >> (istream& is, datum& D);
/*********************************************
** Main FUNCTION
*********************************************/
int main()
{
// Open file and read heading info
int N;
string s;
ifstream fin("trial.txt");
fin >> N >> s >> s;
// TO DO: Fill out the code
return 0;
}
/*********************************************
** DEFINITIONS
*********************************************/
istream& operator >> (istream& is, point &p)
{
char c;
return is >> c >> p.x >> c >> p.y >> c;
}
ostream& operator << (ostream& os, point p)
{
return os << '(' << p.x << ',' << p.y << ')';
}
istream& operator >> (istream& is, hhmmss& T)
{
char c;
return is >> c >> T.h >> c >> T.m >> c >> T.s >> c;
}
bool operator<(hhmmss a, hhmmss b)
{
// TO DO: Fill out the code
}
istream& operator >> (istream& is, datum& D)
{
// TO DO: Fill out the code
}