# Exercício Prático 3 - Simulador de Regras de Árvore de Decisão

def classificar_credito(renda, inadimplente, score):
    # Nó Raiz: Teste de Renda
    if renda > 5000:
        # Nó Interno 1
        if not inadimplente:
            return "Aprovado - Limite Alto"
        else:
            return "Aprovado - Limite Médio"
    else:
        # Nó Interno 2
        if score > 700:
            return "Aprovado - Limite Inicial"
        else:
            return "Negado"

# Lote de clientes para teste
novos_clientes = [
    {"nome": "Lucas", "renda": 7500, "inadimplente": False, "score": 800},
    {"nome": "Mariana", "renda": 3200, "inadimplente": False, "score": 750},
    {"nome": "Roberto", "renda": 2800, "inadimplente": True, "score": 550}
]

print("=== AVALIAÇÃO AUTOMÁTICA DE CRÉDITO ===")
for cliente in novos_clientes:
    resultado = classificar_credito(
        cliente["renda"], 
        cliente["inadimplente"], 
        cliente["score"]
    )
    print(f"Cliente: {cliente['nome']} -> Decisão da Árvore: {resultado}")