-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAluno.java
41 lines (34 loc) · 1005 Bytes
/
Aluno.java
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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package gustavohoresteesantosbarros_atividadeavaliativa2;
/**
*
* @author gustavohorestee
*/
public class Aluno {
private double notas;
private Curso curso;
public void setCurso(Curso curso) {
this.curso = curso;
}
public Curso getCurso() {
return curso;
}
public void setNotas(double notas) {
this.notas = notas;
}
public double getNotas() {
return notas;
}
public void imprimir() {
System.out.println("Aluno: ");
System.out.println("Notas: " + notas);
if (curso != null) {
System.out.println("Curso: " + curso.getNome()); // Supondo que a classe Curso tenha um método getNome().
} else {
System.out.println("Curso: Nenhum curso atribuído");
}
}
}