def attendance_percentage(total_classes: int, attended: int) -> float:
    """Calculate attendance percentage."""
    if total_classes <= 0:
        raise ValueError("Total classes must be greater than 0")
    return (attended / total_classes) * 100


def is_eligible(total_classes: int, attended: int, required: float = 75) -> bool:
    """Check if student is eligible based on required attendance."""
    return attendance_percentage(total_classes, attended) >= required
