void ReadDay(ifstream& fin, Date d1, Time t1, Time t2) { int attendance; fin >> d1.year >> d1.month >> d1.day >> t1.hour >> t1.minute >> t2.hour >> t2.minute >> attendance; } void ReadAttendance(ifstream& fin, int d, Date d1, Date d2, Time t1, Time t2) { int distance; // See the distance to the date to be considered if (DayOfWeek(d1) <= d) distance = d - DayOfWeek(d1); else distance = 8 - DayOfWeek(d1) + d - 1; // Move to the date in considered NextDays(d1, distance); while (CompareDay(d1, d2) <= 0) //Use loop to compare 2 times { ReadDay(fin, d1, t1, t2); NextDays(d1, 7); } }