def calculate_grade(grade):
    """Function that calculates final grades based on points earned."""
    if grade >= 90:
        if grade == 100:
            return 'A+'
        return 'A'
    if grade >= 80:
        return 'B'
    if grade >= 70:
        return 'C'
    return 'F'