int main() { Date d1; printf("Enter first date (mm/dd/yy): "); scanf("%d/%d/%d", &d1.month, &d1.day, &d1.year); Date d2; printf("Enter second date (mm/dd/yy): "); scanf("%d/%d/%d", &d2.month, &d2.day, &d2.year); // I changed this method to return a bool, because we don't actually // properly handle when they are the same date in the stub code anyway. // Ideally, we would check < 0, == 0, and > 0, rather than < 0 else. if (earlierThan(d1, d2)) { putDate(d1); printf(" is earlier than "); putDate(d2); } else { putDate(d2); printf(" is earlier than "); putDate(d1); } printf("\n"); return 0; }
void KmlGenerator::putKmlHeader() { time_t t = time(0); std::tm *now = localtime(&t); startKml(); skipLine(); putComment("====================================================================================================================="); putComment("This file was generated automatically with real meteorological data and is part of the Ensimag visualization project."); putComment("====================================================================================================================="); skipLine(); startDocument("Root"); putName("Environemental contaminant viewer"); putDescription("PM10 particles"); putDate(*now, YYYY_MM_DD_hh_mm_ss); putAuthor("Jean-Baptiste Keck"); putAuthor("Alexandre Ribard"); skipLine(); putVisibility(true); putOpen(true); skipLine(); }