bool AssignmentList::find(Assignment inputAssignment) { for (AssignmentIterator = theData.begin(); AssignmentIterator != theData.end(); AssignmentIterator++) { if (AssignmentIterator->obtainAssignedDate() == inputAssignment.obtainAssignedDate()) return true; } return false; }
bool AssignmentList::addAssignment(Assignment inputAssignment) { if (inputAssignment.hasInvalidDate()) return false; if (!find(inputAssignment)) // Look for assignment with same assigned date. { if (!(inputAssignment.obtainDueDate() <= inputAssignment.obtainAssignedDate())) { insert(inputAssignment); if (inputAssignment.obtainStatus() == 2) lateAssignments++; // Keep track of late assignments. return true; } } return false; }