-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAluno.java
More file actions
54 lines (49 loc) · 1.14 KB
/
Aluno.java
File metadata and controls
54 lines (49 loc) · 1.14 KB
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
49
50
51
52
53
54
package ATIVIDADE1;
public class Aluno implements Comparable <Aluno> {
private String matr;
private String nome;
private double media;
private int faltas;
// Construtor
public Aluno (String m, String n) {
this.matr = m;
this.nome = n;
}
public Aluno (String matr){
this.matr = matr;
}
public String getMatricula(){
return this.matr;
}
public String getNome(){
return this.nome;
}
public double getMedia(){
return this.media;
}
public int getFaltas(){
return this.faltas;
}
public void setMatricula (String matr){
this.matr = matr;
}
public void setNome(String nome){
this.nome = nome;
}
public void setMedia(double media){
this.media = media;
}
public void setFaltas(int faltas){
this.faltas = faltas;
}
@Override
public String toString () {
return this.matr + " " + this.nome + " " + this.media + " " + this.faltas;
}
@Override
public int compareTo(Aluno al){
int result;
result = this.getMatricula().compareTo(al.getMatricula());
return result;
}
}