public class AlunoBCC {
    // Atributos privados (Encapsulamento)
    private String nome;
    private String ra;
    private double notaN1;
    private double notaN2;

    // Atributo estático para contar quantos alunos foram criados no sistema
    private static int totalAlunosCadastrados = 0;

    // Construtor
    public AlunoBCC(String nome, String ra) {
        this.nome = nome;
        this.ra = ra;
        totalAlunosCadastrados++; // Incrementa o contador global da classe
    }

    // Métodos de Regra de Negócio
    public double calcularMediaSemestral() {
        return (this.notaN1 * 0.4) + (this.notaN2 * 0.6); // Média ponderada FMU
    }

    public boolean verificarAprovação() {
        return this.calcularMediaSemestral() >= 6.0;
    }

    // Getters e Setters com Validação
    public String getNome() { return nome; }
    public void setNome(String nome) { this.nome = nome; }

    public String getRa() { return ra; }

    public double getNotaN1() { return notaN1; }
    public void setNotaN1(double notaN1) {
        if (notaN1 >= 0.0 && notaN1 <= 10.0) {
            this.notaN1 = notaN1;
        } else {
            System.out.println("Erro: Nota N1 deve estar entre 0.0 e 10.0");
        }
    }

    public double getNotaN2() { return notaN2; }
    public void setNotaN2(double notaN2) {
        if (notaN2 >= 0.0 && notaN2 <= 10.0) {
            this.notaN2 = notaN2;
        } else {
            System.out.println("Erro: Nota N2 deve estar entre 0.0 e 10.0");
        }
    }

    // Método estático
    public static int getTotalAlunosCadastrados() {
        return totalAlunosCadastrados;
    }
}