Student.java 1.05 KB
Newer Older
Cesar Giulano Gonzalez Maqueda committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
public class Student {
    Notas notas;
    public Student(Notas notas){
        this.notas = notas;
    }

    public void preguntarNotas(){
        System.out.println("Las notas del estudiante son: ");
        int[] notass = notas.getNotas();
        for(int nota: notass){
            System.out.println(nota);
        }
    }

    public static void main(String[] args){
        int[] notasTemp = {2, 3, 4, 5, 4};
        Notas notas = new Notas(notasTemp, "Asuncion, Barrio Las Mercedes");
        Student estudiante = new Student(notas);
        estudiante.preguntarNotas();
    }
}

class Notas {
    private int[] notas;
    private String direccion;

    public Notas(int[] notas, String direccion){
        this.notas = notas;
        this.direccion = direccion;
    }


    public int[] getNotas() {
        return notas;
    }

    public void setNotas(int[] notas) {
        this.notas = notas;
    }

    private String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }
}