Пример #1
0
bool AssignmentList::find(Assignment inputAssignment)
{
    for (AssignmentIterator = theData.begin();
        AssignmentIterator != theData.end();
        AssignmentIterator++)
    {
        if (AssignmentIterator->obtainAssignedDate()
            == inputAssignment.obtainAssignedDate())
            return true;
    }
    return false;
}
Пример #2
0
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;
}